Class AntColony¶
- Defined in File ant_colony.hpp
Inheritance Relationships¶
Base Type¶
public Planner
(Class Planner)
Class Documentation¶
-
class
AntColony
: public Planner¶ Class for objects that plan using the Ant Colony algorithm.
Public Functions
-
AntColony
(const std::vector<std::vector<int>> &grid)¶ Constructor.
- Return
- no return value
- Parameters
grid
: the grid on which the planner is to plan
-
void
SetParams
(const int n_ants = 10, const double alpha = 1, const double beta = 0.2, const double evap_rate = 0.5, const double Q = 10, const int iterations = 50)¶ Constructor for set up of Ant Colony class.
- Return
- no return value
- Parameters
n_ants
: number of ants yo be created in every iterationsalpha
: value of exponent for the use of the pheromone trails in assigning probability to possible next positionsbeta
: value of exponent for the use of the heuristic in assigning probability to possible next positionsevap_rate
: evaporation rate of the pheromone trail as a value between 0 and 1iterations
: number of iterations of the simulationQ
: Constant multiplication factor for the cost/reward function
-
void
PrintAntPath
(Ant &ant) const¶ Prints the path taken by the ant.
Prints the path taken by the ant on the grid, using the PrintPath function in
utils.cpp. It can be used to print incomplete paths as well, as long as the end point and start point are specified.- Return
- void
- Parameters
ant
: ant for which the path is to be printed.
-