public class forgetfulAntSystem
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
actualIteration |
private double |
alpha |
private ant[] |
antColony |
private int |
ants |
private double |
bestProblemCost |
private double |
beta |
private double |
evaporationP |
private double |
exTh |
private java.util.List<flight> |
flights |
private double[][] |
heuristic |
private double[][] |
infoAnts |
private int |
maxIterations |
private double |
maxTrail |
private double[][] |
trail |
Constructor and Description |
---|
forgetfulAntSystem(double alpha,
double beta,
double exTh,
double evaporation,
java.util.List<flight> flights,
int ants,
int it,
double initialTrail)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
calculateBestCost()
Function that uses all information saved during all the iterations to calculate
statistics and print them to the console.
|
java.util.List<java.lang.Integer> |
calculateBestPaths()
Function that checks which ant has constructed the best path
|
void |
init()
Init function for the algorithm
|
void |
initTrailAndHeuristic()
Initialize pheromone trails and heuristic parameters for each arc
|
void |
updatePheromoneTrail()
Function that updates pheromone trails. .
|
private double alpha
private double beta
private double exTh
private double evaporationP
private java.util.List<flight> flights
private double[][] trail
private double[][] heuristic
private double bestProblemCost
private int ants
private int maxIterations
private ant[] antColony
private double maxTrail
private double[][] infoAnts
private int actualIteration
public forgetfulAntSystem(double alpha, double beta, double exTh, double evaporation, java.util.List<flight> flights, int ants, int it, double initialTrail)
alpha:
- Pheromone modifierbeta:
- Heuristic modifierexTh:
- Transition State function control parameterevaporation:
- Pheromone evaporation per iterationflights:
- List of flights for the problemants:
- Number of agentsit:
- Max number of iterations allowedinitialTrail:
- Initial pheromone trailpublic void init()
public void initTrailAndHeuristic()
public void updatePheromoneTrail()
public java.util.List<java.lang.Integer> calculateBestPaths()
public void calculateBestCost()