Class BasicAnt
java.lang.Object
unifeat.featureSelection.wrapper.ACOBasedMethods.BasicAnt
- Direct Known Subclasses:
Ant
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
Modifier and TypeFieldDescriptionprivate double
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.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.toString()
Returns a string representation of the ant.
-
Field Details
-
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
This method returns the current selected feature subset by the ant.- Returns:
- an array list of the selected feature subset by the ant
-
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
Returns a string representation of the ant.
-