|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectPherMatrix
public class PherMatrix
PherMatrix keep tracks of the pheromone values for individual moves and updates them as requested. Pheromone values are used in determining the atractiveness of a certain move.
Field Summary | |
---|---|
ACS |
acsLocal
|
double |
CONSTANTQ
|
int[][] |
distances
|
Node[] |
nodes
|
double |
PHEREVAP
|
double[][] |
pherValues
|
double[] |
resetValues
|
int[] |
valids
|
Constructor Summary | |
---|---|
PherMatrix(ACS acs)
|
Method Summary | |
---|---|
void |
addNode(int n)
Notifies PherMatrix of a node addition. |
void |
addNodeDistanceBased(int n)
Notifies PherMatrix of a node addition. |
void |
addPher(Route route)
Adds pheromone to the arcs that compose the given route. |
void |
addPherACS(Route route)
Adds pheromone to the arcs that compose the given route, based on ACS implementation. |
void |
adjustMinMax(double lower,
double upper)
Modifies pheromone values such that they fall between a lower and upper value. |
void |
arcCrossed(int n,
int k)
Removes pheromone from an arc, based on ACS implementation. |
void |
evaporatePher()
Evaporates all pheromone values. |
double |
findMaxDistance()
Debugging method to view largest pheromone value. |
double |
findMinDistance()
Debugging method to view smallest pheromone value. |
double |
findPherAverage()
Debugging method to view average pheromone value. |
HashRoute |
getPossiblesHash()
Creates a hashroute containing all the avaliable nodes to move to. |
int |
greatestDistanceFromNode(int r)
Helper method for node addition/removal. |
void |
implementResetValues()
Resets all pheromone based on their individual reset values. |
void |
intializePherValues()
Intializes the pheromone matrix. |
void |
removeNode(int n)
Notifies PherMatrix of a node removal. |
void |
resetProblem()
Resets all pheromone to their intial values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Node[] nodes
public int[] valids
public double[] resetValues
public int[][] distances
public double[][] pherValues
public double CONSTANTQ
public double PHEREVAP
public ACS acsLocal
Constructor Detail |
---|
public PherMatrix(ACS acs)
Method Detail |
---|
public void intializePherValues()
public HashRoute getPossiblesHash()
public void evaporatePher()
public void addPher(Route route)
route
- The route that pheromone is added topublic void addPherACS(Route route)
route
- The route that pheromone is added topublic void arcCrossed(int n, int k)
n
- First node of the arck
- Second node of the arcpublic void adjustMinMax(double lower, double upper)
lower
- The lower limit on pheromoneupper
- The upper limit on pheromonepublic void removeNode(int n)
n
- The node removedpublic void addNode(int n)
n
- The node addedaddNodeDistanceBased(int n)
public void addNodeDistanceBased(int n)
n
- The node addedpublic int greatestDistanceFromNode(int r)
r
- The node being added/removed
public void resetProblem()
public void implementResetValues()
public double findPherAverage()
public double findMaxDistance()
public double findMinDistance()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |