jmetal.util
Class AdaptiveGrid

java.lang.Object
  extended by jmetal.util.AdaptiveGrid

public class AdaptiveGrid
extends java.lang.Object

This class defines an adaptive grid over a SolutionSet as the one used the algorithm PAES.


Constructor Summary
AdaptiveGrid(int bisections, int objetives)
          Constructor.
 
Method Summary
 void addSolution(int location)
          Increases the number of solutions into a specific hypercube.
 int calculateOccupied()
          Calculates the number of hypercubes having one or more solutions.
 int getBisections()
          Returns the number of bi-divisions performed in each objective.
 int getLocationDensity(int location)
          Returns the number of solutions into a specific hypercube.
 int getMostPopulated()
          Returns the value of the most populated hypercube.
 int location(Solution solution)
          Calculates the hypercube of a solution.
 int occupiedHypercubes()
          Returns the number of hypercubes with more than zero solutions.
 int randomOccupiedHypercube()
          Returns a random hypercube that has more than zero solutions.
 void removeSolution(int location)
          Decreases the number of solutions into a specific hypercube.
 int rouletteWheel()
          Returns a random hypercube using a rouleteWheel method.
 java.lang.String toString()
          Retunrns a String representing the grid.
 void updateGrid(SolutionSet solutionSet)
          Updates the grid limits and the grid content adding the solutions contained in a specific SolutionSet.
 void updateGrid(Solution solution, SolutionSet solutionSet)
          Updates the grid limits and the grid content adding a new Solution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AdaptiveGrid

public AdaptiveGrid(int bisections,
                    int objetives)
Constructor. Creates an instance of AdaptativeGrid.

Parameters:
bisections - Number of bi-divisions of the objective space.
objetives - Number of objectives of the problem.
Method Detail

updateGrid

public void updateGrid(SolutionSet solutionSet)
Updates the grid limits and the grid content adding the solutions contained in a specific SolutionSet.

Parameters:
solutionSet - The SolutionSet.

updateGrid

public void updateGrid(Solution solution,
                       SolutionSet solutionSet)
Updates the grid limits and the grid content adding a new Solution. If the solution falls out of the grid bounds, the limits and content of the grid must be re-calculated.

Parameters:
solution - Solution considered to update the grid.
solutionSet - SolutionSet used to update the grid.

location

public int location(Solution solution)
Calculates the hypercube of a solution.

Parameters:
solution - The Solution.

getMostPopulated

public int getMostPopulated()
Returns the value of the most populated hypercube.

Returns:
The hypercube with the maximum number of solutions.

getLocationDensity

public int getLocationDensity(int location)
Returns the number of solutions into a specific hypercube.

Parameters:
location - Number of the hypercube.
Returns:
The number of solutions into a specific hypercube.

removeSolution

public void removeSolution(int location)
Decreases the number of solutions into a specific hypercube.

Parameters:
location - Number of hypercube.

addSolution

public void addSolution(int location)
Increases the number of solutions into a specific hypercube.

Parameters:
location - Number of hypercube.

getBisections

public int getBisections()
Returns the number of bi-divisions performed in each objective.

Returns:
the number of bi-divisions.

toString

public java.lang.String toString()
Retunrns a String representing the grid.

Overrides:
toString in class java.lang.Object
Returns:
The String.

rouletteWheel

public int rouletteWheel()
Returns a random hypercube using a rouleteWheel method.

Returns:
the number of the selected hypercube.

calculateOccupied

public int calculateOccupied()
Calculates the number of hypercubes having one or more solutions. return the number of hypercubes with more than zero solutions.


occupiedHypercubes

public int occupiedHypercubes()
Returns the number of hypercubes with more than zero solutions.

Returns:
the number of hypercubes with more than zero solutions.

randomOccupiedHypercube

public int randomOccupiedHypercube()
Returns a random hypercube that has more than zero solutions.

Returns:
The hypercube.