Class BasicGraphRepresentation

java.lang.Object
unifeat.featureSelection.wrapper.ACOBasedMethods.BasicGraphRepresentation
Direct Known Subclasses:
GraphRepresentation

public abstract class BasicGraphRepresentation extends Object
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
    Modifier and Type
    Field
    Description
    protected double[][]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    BasicGraphRepresentation(int rows, int cols)
    Initializes the parameters
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    fillPheromoneArray(double value)
    This method fills all entries of the pheromone array with a specific input value.
    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
    protected abstract void
    setPheromone(double value, int indexRow, int indexCol)
    This method sets a pheromone value in a specific entry of the array.
    Returns a string representation of the graph.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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 array
      cols - 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 value
      indexRow - the index of the row in the pheromone array
      indexCol - 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 array
      indexCol - 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

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