Class Colony
java.lang.Object
unifeat.featureSelection.wrapper.ACOBasedMethods.BasicColony<Ant>
unifeat.featureSelection.wrapper.ACOBasedMethods.OptimalACO.Colony
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 Summary
Fields inherited from class unifeat.featureSelection.wrapper.ACOBasedMethods.BasicColony
ALPHA, BETA, colony, COLONY_SIZE, fitnessEvaluator, graphRepresentation, INIT_PHEROMONE_VALUE, NUM_ORIGINAL_FEATURE, RHO
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
This method constructs solutions completely of each ant in the colony by applying state transition rule repeatedly.evaluateCurrentSolution
(int antIndex) This method evaluates the fitness of each ant in the colony by predefined fitness function.This method returns the best ant in the colonyvoid
This method initializes the problem parameters.void
This method updates the current pheromone values by decreasing pheromone concentrations and then deposit the quantity of pheromone by ants.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.void
This method places any ant randomly to one feature as their initial states.Methods inherited from class unifeat.featureSelection.wrapper.ACOBasedMethods.BasicColony
toString
-
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 classBasicColony<Ant>
-
setInitialState
public void setInitialState()This method places any ant randomly to one feature as their initial states.- Specified by:
setInitialState
in classBasicColony<Ant>
-
evaluateCurrentSolution
This method evaluates the fitness of each ant in the colony by predefined fitness function.- Specified by:
evaluateCurrentSolution
in classBasicColony<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 classBasicColony<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 classBasicColony<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 classBasicColony<Ant>
-
getBestAnt
This method returns the best ant in the colonyBest ant is selected based on classifier performance and length of selected subsets.
- Specified by:
getBestAnt
in classBasicColony<Ant>
- Returns:
- the best ant in the colony
-