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

public class RandomNodeSelection<C,E extends Environment> extends AntPolicy<C,E>
This is the node selection policy used in Ant System algorithms, also known as Random Proportional Rule.
Author:
Carlos G. Gavidia
  • Constructor Details

    • RandomNodeSelection

      public RandomNodeSelection()
  • Method Details

    • applyPolicy

      public boolean applyPolicy(E environment, ConfigurationProvider configurationProvider)
      Specified by:
      applyPolicy in class AntPolicy<C,E extends Environment>
    • getNextComponent

      public C getNextComponent(Map<C,Double> componentsWithProbabilities)
    • 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

      public Map<C,Double> getProbabilitiesForNeighbourhood(E environment, ConfigurationProvider configurationProvider, List<C> neighborhood)
    • doIfNoComponentsFound

      protected HashMap<C,Double> doIfNoComponentsFound(E environment, ConfigurationProvider configurationProvider)
    • getHeuristicTimesPheromone

      public Double getHeuristicTimesPheromone(E environment, ConfigurationProvider configurationProvider, C possibleMove)
    • toString

      public String toString()
      Overrides:
      toString in class Object