java.lang.Object
unifeat.featureSelection.wrapper.ACOBasedMethods.BasicColony<Ant>
unifeat.featureSelection.wrapper.ACOBasedMethods.OptimalACO.Colony

public class Colony extends BasicColony<Ant>
This java class is used to implement a colony of ants in optimal ant colony optimization (Optimal ACO) method in which the type of ant is extended from Ant class.
Author:
Sina Tabakhi
See Also:
  • Field Details

    • PHI

      public static double PHI
  • Constructor Details

    • Colony

      public Colony(double phi)
      Initializes the parameters
      Parameters:
      phi - the phi parameter used in the pheromone update rule for controlling the relative weight of classifier performance and feature subset length
  • Method Details

    • initialization

      public void initialization()
      This method initializes the problem parameters.
      Specified by:
      initialization in class BasicColony<Ant>
    • setInitialState

      public void setInitialState()
      This method places any ant randomly to one feature as their initial states.
      Specified by:
      setInitialState in class BasicColony<Ant>
    • evaluateCurrentSolution

      public Criteria evaluateCurrentSolution(int antIndex)
      This method evaluates the fitness of each ant in the colony by predefined fitness function.
      Specified by:
      evaluateCurrentSolution in class BasicColony<Ant>
      Parameters:
      antIndex - index of the ant in the colony
      Returns:
      Criteria values of the fitness function
      See Also:
    • operateStateTransitionRule

      public void operateStateTransitionRule(int antIndex)
      This method selects the next state and adds it to the current selected feature subset by using state transition rule that is combination of heuristic desirability and pheromone levels.

      Classifier performance is used as heuristic desirability.

      Specified by:
      operateStateTransitionRule in class BasicColony<Ant>
      Parameters:
      antIndex - index of the ant in the colony
    • constructSolution

      public void constructSolution()
      This method constructs solutions completely of each ant in the colony by applying state transition rule repeatedly.
      Specified by:
      constructSolution in class BasicColony<Ant>
    • operatePheromoneUpdateRule

      public void operatePheromoneUpdateRule()
      This method updates the current pheromone values by decreasing pheromone concentrations and then deposit the quantity of pheromone by ants.

      Best ant deposits additional pheromone on nodes of the best solution.

      Specified by:
      operatePheromoneUpdateRule in class BasicColony<Ant>
    • getBestAnt

      public Ant getBestAnt()
      This method returns the best ant in the colony

      Best ant is selected based on classifier performance and length of selected subsets.

      Specified by:
      getBestAnt in class BasicColony<Ant>
      Returns:
      the best ant in the colony
    • getColonySize

      public int getColonySize()
      This method returns the size of the colony.
      Returns:
      the number of ants in the colony