Package isula.aco.algorithms.antsystem
Class RandomNodeSelection<C,E extends Environment>
java.lang.Object
isula.aco.AntPolicy<C,E>
isula.aco.algorithms.antsystem.RandomNodeSelection<C,E>
- Type Parameters:
C
- Class for components of a solution.E
- Class representing the Environment.
- Direct Known Subclasses:
PseudoRandomNodeSelection
This is the node selection policy used in Ant System algorithms, also known as Random Proportional Rule.
- Author:
- Carlos G. Gavidia
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
applyPolicy
(E environment, ConfigurationProvider configurationProvider) doIfNoComponentsFound
(E environment, ConfigurationProvider configurationProvider) getComponentsWithProbabilities
(E environment, ConfigurationProvider configurationProvider) Gets a probabilities vector, containing probabilities to move to each node according to pheromone matrix.getHeuristicTimesPheromone
(E environment, ConfigurationProvider configurationProvider, C possibleMove) getNextComponent
(Map<C, Double> componentsWithProbabilities) getProbabilitiesForNeighbourhood
(E environment, ConfigurationProvider configurationProvider, List<C> neighborhood) toString()
Methods inherited from class isula.aco.AntPolicy
getAnt, getPolicyType, setAnt
-
Constructor Details
-
RandomNodeSelection
public RandomNodeSelection()
-
-
Method Details
-
applyPolicy
- Specified by:
applyPolicy
in classAntPolicy<C,
E extends Environment>
-
getNextComponent
-
getComponentsWithProbabilities
public Map<C,Double> getComponentsWithProbabilities(E environment, ConfigurationProvider configurationProvider) Gets a probabilities vector, containing probabilities to move to each node according to pheromone matrix.- Parameters:
environment
- Environment that ants are traversing.configurationProvider
- Configuration provider.- Returns:
- Probabilities for the adjacent nodes.
-
getProbabilitiesForNeighbourhood
-
doIfNoComponentsFound
protected HashMap<C,Double> doIfNoComponentsFound(E environment, ConfigurationProvider configurationProvider) -
getHeuristicTimesPheromone
public Double getHeuristicTimesPheromone(E environment, ConfigurationProvider configurationProvider, C possibleMove) -
toString
-