|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectAgent
public class Agent
Agent class is the representation of an individual ant in an ACO algorithm. Agents keep track of their own routes, constructing and updating them as necessary.
Field Summary | |
---|---|
HashRoute |
current
|
private double |
DISTANCEIMPORTANCE
|
private double |
GREEDY
|
private double |
PHERIMPORTANCE
|
private PherMatrix |
pherMatrix
|
Route |
tabu
|
Constructor Summary | |
---|---|
Agent(PherMatrix tempPher,
int startingNode)
Constructs Agent. |
Method Summary | |
---|---|
double |
evalImportance(int x,
int y)
Helper method for move that determines the attractiveness of an arc. |
void |
generateRoute()
Constructs a finished route for the Agent. |
Route |
getFinished()
Returns the finished Route of the Agent. |
int |
move()
Decides which node to move to next based on pheromone and distance information |
void |
reset()
Clears the Route of the Agent and obtains a new HashRoute of valid nodes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Route tabu
public HashRoute current
private PherMatrix pherMatrix
private double PHERIMPORTANCE
private double DISTANCEIMPORTANCE
private double GREEDY
Constructor Detail |
---|
public Agent(PherMatrix tempPher, int startingNode)
tempPher
- PherMatrix of the problemstartingNode
- Node number that the ant starts onMethod Detail |
---|
public int move()
public void generateRoute()
move()
public Route getFinished()
public void reset()
public double evalImportance(int x, int y)
x
- First nodey
- Second node
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |