⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pheromones.cs

📁 包括Pheromones Algorythm、Memory Algorythm和Hill Climbing Algorythm I
💻 CS
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -