-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAnt.cs
executable file
·46 lines (36 loc) · 1.29 KB
/
Ant.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AntColonySimulation
{
class Ant
{
public int X { set; get; }
public int Y { set; get; }
public bool isCarrying { set; get; }
public bool isCloseToAnt { set; get; }
public bool isCloseToNest { set; get; }
public bool isCloseToFood { set; get; }
public bool isCloseToRobberNest { set; get; }
public int closestAnt { set; get; }
public bool foodLocationKnown { set; get; }
public int foodClosest { set; get; }
public bool nestLocationKnown { set; get; }
public int nestClosest { set; get; }
public int robberNestClosest { set; get; }
private Random randomObj;
/// <summary>
/// Assigns the values of the x and y coordinates given to the existing properties X and Y.
/// </summary>
/// <param name="rand">Random object</param>
public Ant(Random rand)
{
randomObj = rand;
X = randomObj.Next(0,600);
Y = randomObj.Next(0,450);
Console.WriteLine("ant created at {0},{1} ", X, Y);
}
}
}