java.lang.Object
unifeat.featureSelection.wrapper.ACOBasedMethods.BasicAnt
Direct Known Subclasses:
Ant

public abstract class BasicAnt extends Object
The abstract class contains the main methods and fields that are used in all ACO-based feature selection methods. This class is used to represent an ant in ACO algorithm.
Author:
Sina Tabakhi
  • Field Details

    • featureSubset

      protected ArrayList<Integer> featureSubset
    • fitness

      private double fitness
  • Constructor Details

    • BasicAnt

      public BasicAnt()
      Initializes the parameters
  • Method Details

    • addFeature

      public void addFeature(int featIndex)
      This method adds a specific feature to the current selected feature subset by the ant.
      Parameters:
      featIndex - the index of the feature
    • removeFeature

      public void removeFeature(int featIndex)
      This method removes a specific feature of the current selected feature subset by the ant.
      Parameters:
      featIndex - the index of the feature
    • getFeatureSubset

      public ArrayList<Integer> getFeatureSubset()
      This method returns the current selected feature subset by the ant.
      Returns:
      an array list of the selected feature subset by the ant
    • getFeasibleFeatureSet

      public abstract ArrayList<Integer> getFeasibleFeatureSet()
      This method returns the feasible features that can be added to the current solution of the ant.
      Returns:
      an array list of the feasible features
    • getFeatureSubsetSize

      public int getFeatureSubsetSize()
      This method returns the size of current selected feature subset by the ant.
      Returns:
      the size of current selected feature subset
    • emptyFeatureSubset

      public void emptyFeatureSubset()
      This method clears the current selected feature subset by the ant.
    • getFitness

      public double getFitness()
      This method returns the fitness value of the ant.
      Returns:
      the fitness value of the ant
    • setFitness

      public void setFitness(double fitness)
      This method sets the fitness value of the ant.
      Parameters:
      fitness - the fitness value of the ant
    • toString

      public String toString()
      Returns a string representation of the ant.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the ant.