Class BasicGraphRepresentation
java.lang.Object
unifeat.featureSelection.wrapper.ACOBasedMethods.BasicGraphRepresentation
- Direct Known Subclasses:
GraphRepresentation
The abstract class contains the main methods and fields that are used to
represent discrete search space as a graph in ACO algorithm. The graph is
implemented as an 2D array.
- Author:
- Sina Tabakhi
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfillPheromoneArray(double value) This method fills all entries of the pheromone array with a specific input value.abstract doublegetPheromone(int indexRow, int indexCol) This method returns a pheromone value in a specific entry of the pheromone array that is determined by indeces of the row and columnprotected abstract voidsetPheromone(double value, int indexRow, int indexCol) This method sets a pheromone value in a specific entry of the array.toString()Returns a string representation of the graph.
-
Field Details
-
pheromone
protected double[][] pheromone
-
-
Constructor Details
-
BasicGraphRepresentation
public BasicGraphRepresentation(int rows, int cols) Initializes the parameters- Parameters:
rows- the number of rows in the pheromone arraycols- the number of columns in the pheromone array
-
-
Method Details
-
setPheromone
protected abstract void setPheromone(double value, int indexRow, int indexCol) This method sets a pheromone value in a specific entry of the array.- Parameters:
value- the input pheromone valueindexRow- the index of the row in the pheromone arrayindexCol- the index of the column in the pheromone array
-
getPheromone
public abstract double getPheromone(int indexRow, int indexCol) This method returns a pheromone value in a specific entry of the pheromone array that is determined by indeces of the row and column- Parameters:
indexRow- the index of the row in the pheromone arrayindexCol- the index of the column in the pheromone array- Returns:
- a pheromone value
-
fillPheromoneArray
public void fillPheromoneArray(double value) This method fills all entries of the pheromone array with a specific input value.- Parameters:
value- the input value
-
toString
Returns a string representation of the graph.
-