Class AdaptiveGrid<S extends Solution<?>>

java.lang.Object
org.uma.jmetal.util.AdaptiveGrid<S>

public class AdaptiveGrid<S extends Solution<?>> extends Object
This class defines an adaptive grid over a list of solutions as the one used by algorithm PAES.
Author:
Antonio J. Nebro, Juan J. Durillo
  • Constructor Details

    • AdaptiveGrid

      public AdaptiveGrid(int bisections, int objectives)
      Constructor. Creates an instance of AdaptiveGrid.
      Parameters:
      bisections - Number of bi-divisions of the objective space.
      objectives - Number of numberOfObjectives of the problem.
  • Method Details

    • updateGrid

      public void updateGrid(List<S> solutionList)
      Updates the grid limits and the grid content adding the solutions contained in a specific solutionList.
      Parameters:
      solutionList - The solutionList.
    • updateGrid

      public void updateGrid(S solution, List<S> 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(S solution)
      Calculates the hypercube of a solution
      Parameters:
      solution - The Solution.
    • getMostPopulatedHypercube

      public int getMostPopulatedHypercube()
      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 String toString()
      Returns a String representing the grid.
      Overrides:
      toString in class Object
      Returns:
      The String.
    • rouletteWheel

      public int rouletteWheel()
      Returns a random hypercube using a rouleteWheel method.
      Returns:
      the number of the selected hypercube.
    • rouletteWheel

      public int rouletteWheel(BoundedRandomGenerator<Double> randomGenerator)
      Returns a random hypercube using a rouletteWheel method.
      Parameters:
      randomGenerator - the BoundedRandomGenerator to use for the roulette
      Returns:
      the number of the selected hypercube.
    • calculateOccupied

      public void 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.
    • randomOccupiedHypercube

      public int randomOccupiedHypercube(BoundedRandomGenerator<Integer> randomGenerator)
      Returns a random hypercube that has more than zero solutions.
      Parameters:
      randomGenerator - the BoundedRandomGenerator to use for selecting the hypercube
      Returns:
      The hypercube.
    • getAverageOccupation

      public double getAverageOccupation()
      Return the average number of solutions in the occupied hypercubes
    • getHypercubes

      public int[] getHypercubes()