Class MMAS

  • All Implemented Interfaces:
    java.util.Comparator<Ant>

    public abstract class MMAS
    extends Metaheuristic
    This class belong to the core classes of the Ant Framework.

    First introduced by Stutzle and Hoos, this class implements the Min-Max Ant System algorithm. This algorithm was conceived as a fix of the prematurely stagnation behavior of AS for complex problem. Stagnation means that all ants follow exactly the same path, and premature stagnation occurs when ants explore little and too rapidly exploit the highest pheromone concentrations. The main differences between MMAS and AS is that pheromone intensities are restricted within given intervals and initial pheromoes are set to a max allowed value.

    • Field Detail

      • debug

        public static final boolean debug
        If true, print debug information over System.out.println
        See Also:
        Constant Field Values
      • pheromonesEvaporationRate

        protected static final int pheromonesEvaporationRate
        Holds the rate at which pheromones will evaporate in the pheromonesEvaporation() method
        See Also:
        Constant Field Values
      • tau_min

        protected static final int tau_min
        Minimun value for the pheromone trail
        See Also:
        Constant Field Values
      • tau_max

        protected static final int tau_max
        Maximun value for the pheromone trail
        See Also:
        Constant Field Values
    • Constructor Detail

      • MMAS

        protected MMAS​(Enviroment E)
        Constructor. Allocates the enviroment.
        Parameters:
        E - enviroment
      • MMAS

        protected MMAS()
        Constructor. Empty constructor.
    • Method Detail

      • checkParameters

        public void checkParameters()
                             throws AntFrameworkException
        Description copied from class: Metaheuristic
        Checks whether or not all of the algorithm's parameters exists. If some obligatory parameter do not exist, the function throws an exception. If some other parameter do not exists but it is possible to set a default value, here is the place to do it.
        Specified by:
        checkParameters in class Metaheuristic
        Throws:
        AntFrameworkException
      • stagnationPoint

        public boolean stagnationPoint()
      • decisionRule

        public int decisionRule​(int i,
                                java.util.List<java.lang.Integer> currentSolution)
        Description copied from class: Metaheuristic
        Used by ants to decided the next node to visit.
        Specified by:
        decisionRule in class Metaheuristic
        Parameters:
        i - source node
        currentSolution - currentSolution
        Returns:
        destination node
      • pheromonesUpdate

        public void pheromonesUpdate()
        Description copied from class: Metaheuristic
        Updates the pheromone trail contained in the enviroment E according to some ACO algorithm specific logic
        Specified by:
        pheromonesUpdate in class Metaheuristic
      • pheromonesEvaporation

        public final void pheromonesEvaporation()
        Description copied from class: Metaheuristic
        Evaporates the pheromone trail contained in the enviroment E according to some ACO algorithm specific logic
        Specified by:
        pheromonesEvaporation in class Metaheuristic
      • solve

        public void solve()
                   throws AntFrameworkException
        Description copied from class: Metaheuristic
        This is the body of the algorithm. Implements the fundamental logic and calls to other functions: pheromonesUpdate,pheromonesEvaporation.. according to some ACO algorithm specific logic
        Specified by:
        solve in class Metaheuristic
        Throws:
        AntFrameworkException - AntFrameworkException
      • daemonActions

        public void daemonActions()
        Description copied from class: Metaheuristic
        This function is called on each iteration and it provides a way to implement centralized actions
        Specified by:
        daemonActions in class Metaheuristic
      • candidateList

        public final void candidateList​(int i)
        Description copied from class: Metaheuristic
        Generate, per node in the graph, a list of candidates nodes according to some problem specific heuristic. The candidates are stored in this class's candidates hashtable
        Specified by:
        candidateList in class Metaheuristic
        Parameters:
        i - maximum number of candidates allowed