MOEA Framework 2.12
API Specification

org.moeaframework.core.fitness
Class FitnessBasedArchive

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

public class FitnessBasedArchive
extends NondominatedPopulation

Maintains a non-dominated archive of solutions with a maximum capacity. If the size exceeds the capacity, one or more solutions are pruned based on the fitness calculation. The fitness calculation only occurs when the addition of a solution exceeds the capacity. The fitness can be manually calculated by calling update().


Nested Class Summary
 
Nested classes/interfaces inherited from class org.moeaframework.core.NondominatedPopulation
NondominatedPopulation.DuplicateMode
 
Field Summary
 
Fields inherited from class org.moeaframework.core.NondominatedPopulation
comparator, duplicateMode
 
Constructor Summary
FitnessBasedArchive(FitnessEvaluator evaluator, int capacity)
          Constructs an empty fitness-based archive.
FitnessBasedArchive(FitnessEvaluator evaluator, int capacity, DominanceComparator comparator)
          Constructs an empty fitness-based archive.
FitnessBasedArchive(FitnessEvaluator evaluator, int capacity, DominanceComparator comparator, Iterable<? extends Solution> iterable)
          Constructs a fitness-based archive initialized with the specified solutions.
FitnessBasedArchive(FitnessEvaluator evaluator, int capacity, Iterable<? extends Solution> iterable)
          Constructs a fitness-based archive initialized with the specified solutions.
 
Method Summary
 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 update()
          Updates the fitness of all solutions in this population.
 
Methods inherited from class org.moeaframework.core.NondominatedPopulation
distance, forceAddWithoutCheck, getComparator, isDuplicate, replace
 
Methods inherited from class org.moeaframework.core.Population
addAll, addAll, clear, contains, containsAll, containsAll, get, indexOf, isEmpty, iterator, remove, remove, removeAll, removeAll, size, sort, truncate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FitnessBasedArchive

public FitnessBasedArchive(FitnessEvaluator evaluator,
                           int capacity)
Constructs an empty fitness-based archive.

Parameters:
evaluator - the fitness evaluator for computing the fitness of solutions
capacity - the maximum capacity of this archive

FitnessBasedArchive

public FitnessBasedArchive(FitnessEvaluator evaluator,
                           int capacity,
                           DominanceComparator comparator)
Constructs an empty fitness-based archive.

Parameters:
evaluator - the fitness evaluator for computing the fitness of solutions
capacity - the maximum capacity of this archive
comparator - the dominance comparator

FitnessBasedArchive

public FitnessBasedArchive(FitnessEvaluator evaluator,
                           int capacity,
                           DominanceComparator comparator,
                           Iterable<? extends Solution> iterable)
Constructs a fitness-based archive initialized with the specified solutions.

Parameters:
evaluator - the fitness evaluator for computing the fitness of solutions
capacity - the maximum capacity of this archive
comparator - the dominance comparator
iterable - the solutions used to initialize this population

FitnessBasedArchive

public FitnessBasedArchive(FitnessEvaluator evaluator,
                           int capacity,
                           Iterable<? extends Solution> iterable)
Constructs a fitness-based archive initialized with the specified solutions.

Parameters:
evaluator - the fitness evaluator for computing the fitness of solutions
capacity - the maximum capacity of this archive
iterable - the solutions used to initialize this population
Method Detail

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.

update

public void update()
Updates the fitness of all solutions in this population.


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!