pheromones.cs
来自「包括Pheromones Algorythm、Memory Algorythm和」· CS 代码 · 共 106 行
CS
106 行
using System;
namespace Square
{
/// <summary>
/// Idea for the pheromones is that they are used as any type needed therefore they
/// take strings as the type and strings as the direction.
/// </summary>
public class Pheromone
{
/// <summary>
/// Type of pheromone eg FOOD, WAYHOME ETC
/// </summary>
private string strPheromoneType;
/// <summary>
/// direction the pheromone is pointing in
/// </summary>
private string strDirection;
/// <summary>
/// current pheromone value
/// </summary>
private int nPheromone;
/// <summary>
/// maximum amount of ant pheromones allowed
/// </summary>
private int nMaxPheromone;
/// <summary>
/// Type of pheromone eg FOOD, WAYHOME ETC
/// </summary>
public string PheromoneType
{
get
{
return strPheromoneType;
}
set
{
strPheromoneType = value;
}
}
/// <summary>
/// direction the pheromone is pointing in
/// </summary>
public string Direction
{
get
{
return strDirection;
}
set
{
strDirection = value;
}
}
public int PheromoneCount
{
get
{
return nPheromone;
}
set
{
nPheromone = value;
}
}
public int MaxPheromone
{
get
{
return nMaxPheromone;
}
set
{
nMaxPheromone = value;
}
}
public Pheromone()
{
//
// TODO: Add constructor logic here
//
strPheromoneType = "FOOD";
nMaxPheromone = 100;
strDirection = "NONE";
nPheromone = 0;
}
public Pheromone( string pheromoneType )
{
strPheromoneType = pheromoneType;
nMaxPheromone = 100;
strDirection = "NONE";
nPheromone = 0;
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?