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 Summary

    Fields
    Modifier and Type
    Field
    Description
    protected ArrayList<Integer>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initializes the parameters
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addFeature(int featIndex)
    This method adds a specific feature to the current selected feature subset by the ant.
    void
    This method clears the current selected feature subset by the ant.
    abstract ArrayList<Integer>
    This method returns the feasible features that can be added to the current solution of the ant.
    This method returns the current selected feature subset by the ant.
    int
    This method returns the size of current selected feature subset by the ant.
    double
    This method returns the fitness value of the ant.
    void
    removeFeature(int featIndex)
    This method removes a specific feature of the current selected feature subset by the ant.
    void
    setFitness(double fitness)
    This method sets the fitness value of the ant.
    Returns a string representation of the ant.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • 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.