MOEA Framework 2.12
API Specification

org.moeaframework.core
Class AdaptiveGridArchive

java.lang.Object
  extended by org.moeaframework.core.Population
      extended by org.moeaframework.core.NondominatedPopulation
          extended by org.moeaframework.core.AdaptiveGridArchive
All Implemented Interfaces:
Iterable<Solution>

public class AdaptiveGridArchive
extends NondominatedPopulation

Adaptive grid archive. Divides objective space into a number of grid cells, maintaining a count of the number of solutions within each grid cell. When the size of the archive exceeds a specified capacity, a solution from the most crowded grid cell is selected and removed from the archive.

This implementation currently stores the density of each grid cell in an array. As such, pow(numberOfDivisions, numberOfObjectives) can not exceed the storage capacity of an array, or pow(2, 32). We may consider at some point using sparse arrays to remove this limitation.

References:

  1. Knowles, J.D. and Corne, D.W., "Approximating the Nondominated Front using the Pareto Archived Evolution Strategy," Evolutionary Computation, vol. 8, no. 2, pp. 149-172, 2000.
  2. Knowles, J.D. and Corne, D.W., "Properties of an Adaptive Archiving for Storing Nondominated Vectors," IEEE Transactions on Evolutionary Computation, vol. 7, no. 2, pp. 100-116, 2003.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.moeaframework.core.NondominatedPopulation
NondominatedPopulation.DuplicateMode
 
Field Summary
protected  int capacity
          The maximum capacity of this archive.
protected  int[] density
          The number of solutions in each grid cell.
protected  double[] maximum
          The maximum objective value for each dimension.
protected  double[] minimum
          The minimum objective value for each dimension.
protected  int numberOfDivisions
          The number of divisions this archive uses to split each objective.
protected  Problem problem
          The problem for which this archive is used.
 
Fields inherited from class org.moeaframework.core.NondominatedPopulation
comparator, duplicateMode
 
Constructor Summary
AdaptiveGridArchive(int capacity, Problem problem, int numberOfDivisions)
          Constructs an adaptive grid archive with the specified capacity with the specified number of divisions along each objective.
 
Method Summary
protected  void adaptGrid()
          Computes new lower and upper bounds and recalculates the densities of each grid cell.
 boolean add(Solution solution)
          If newSolution is dominates any solution or is non-dominated with all solutions in this population, the dominated solutions are removed and newSolution is added to this population.
 void clear()
          Removes all solutions from this population.
protected  int findDensestCell()
          Returns the index of the grid cell with the largest density.
 int findIndex(Solution solution)
          Returns the index of the specified solution in this adaptive grid archive, or -1 if the solution is not within the current lower and upper bounds.
 int getCapacity()
          Returns the maximum number of solutions stored in this archive.
 int getDensity(int index)
          Returns the density of the solution at the given index.
 int getNumberOfDivisions()
          Returns the number of divisions this archive uses to split each objective.
 Problem getProblem()
          Returns the problem for which this archive is used.
protected  Solution pickSolutionFromDensestCell()
          Returns a solution residing in the densest grid cell.
 void remove(int index)
          Removes the solution at the specified index from this population.
 boolean remove(Solution solution)
          Removes the specified solution from this population, if present.
 
Methods inherited from class org.moeaframework.core.NondominatedPopulation
distance, forceAddWithoutCheck, getComparator, isDuplicate, replace
 
Methods inherited from class org.moeaframework.core.Population
addAll, addAll, contains, containsAll, containsAll, get, indexOf, isEmpty, iterator, removeAll, removeAll, size, sort, truncate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

capacity

protected final int capacity
The maximum capacity of this archive.


problem

protected final Problem problem
The problem for which this archive is used.


numberOfDivisions

protected final int numberOfDivisions
The number of divisions this archive uses to split each objective.


minimum

protected double[] minimum
The minimum objective value for each dimension.


maximum

protected double[] maximum
The maximum objective value for each dimension.


density

protected int[] density
The number of solutions in each grid cell.

Constructor Detail

AdaptiveGridArchive

public AdaptiveGridArchive(int capacity,
                           Problem problem,
                           int numberOfDivisions)
Constructs an adaptive grid archive with the specified capacity with the specified number of divisions along each objective.

Parameters:
capacity - the capacity of this archive
problem - the problem for which this archive is used
numberOfDivisions - the number of divisions this archive uses to split each objective
Throws:
FrameworkException - if pow(numberOfDivisions, numberOfObjectives) exceeds the storage capacity of an array
Method Detail

getCapacity

public int getCapacity()
Returns the maximum number of solutions stored in this archive.

Returns:
the maximum number of solutions stored in this archive

getNumberOfDivisions

public int getNumberOfDivisions()
Returns the number of divisions this archive uses to split each objective.

Returns:
the number of divisions this archive uses to split each objective

getProblem

public Problem getProblem()
Returns the problem for which this archive is used.

Returns:
the problem for which this archive is used

add

public boolean add(Solution solution)
Description copied from class: NondominatedPopulation
If newSolution is dominates any solution or is non-dominated with all solutions in this population, the dominated solutions are removed and newSolution is added to this population. Otherwise, newSolution is dominated and is not added to this population.

Overrides:
add in class NondominatedPopulation
Parameters:
solution - the solution to be added
Returns:
true if the population was modified as a result of this method; false otherwise.

remove

public void remove(int index)
Description copied from class: Population
Removes the solution at the specified index from this population.

Overrides:
remove in class Population
Parameters:
index - the index of the solution to be removed

remove

public boolean remove(Solution solution)
Description copied from class: Population
Removes the specified solution from this population, if present.

Overrides:
remove in class Population
Parameters:
solution - the solution to be removed
Returns:
true if this population was modified as a result of this method; false otherwise

clear

public void clear()
Description copied from class: Population
Removes all solutions from this population.

Overrides:
clear in class Population

findDensestCell

protected int findDensestCell()
Returns the index of the grid cell with the largest density.

Returns:
the index of the grid cell with the largest density

pickSolutionFromDensestCell

protected Solution pickSolutionFromDensestCell()
Returns a solution residing in the densest grid cell. If there are more than one such solution or multiple cells with the same density, the first solution encountered is returned.

Returns:
a solution residing in the densest grid cell

adaptGrid

protected void adaptGrid()
Computes new lower and upper bounds and recalculates the densities of each grid cell.


findIndex

public int findIndex(Solution solution)
Returns the index of the specified solution in this adaptive grid archive, or -1 if the solution is not within the current lower and upper bounds.

Parameters:
solution - the specified solution
Returns:
the index of the specified solution in this adaptive grid archive, or -1 if the solution is not within the current lower and upper bounds

getDensity

public int getDensity(int index)
Returns the density of the solution at the given index.

Parameters:
index - the solution index
Returns:
the density of the solution at the given index

MOEA Framework 2.12
API Specification

Copyright 2009-2016 MOEA Framework. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage. Visit us on Github!