
MOEA Framework 2.12 API Specification 

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object org.moeaframework.core.Population org.moeaframework.core.NondominatedPopulation
public class NondominatedPopulation
A population that maintains the property of pairwise nondominance between
all solutions. When the add
method is invoked with a new solution,
all solutions currently in the population that are dominated by the new
solution are removed. If the new solution is dominated by any member of the
population, the new solution is not added.
Nested Class Summary  

static class 
NondominatedPopulation.DuplicateMode
Specifies how duplicate solutions are handled. 
Field Summary  

protected DominanceComparator 
comparator
The dominance comparator used by this nondominated population. 
protected NondominatedPopulation.DuplicateMode 
duplicateMode
Specifies how duplicate solutions are handled. 
Constructor Summary  

NondominatedPopulation()
Constructs an empty nondominated population using the Pareto dominance relation. 

NondominatedPopulation(DominanceComparator comparator)
Constructs an empty nondominated population using the specified dominance relation. 

NondominatedPopulation(DominanceComparator comparator,
boolean allowDuplicates)
Deprecated. Use NondominatedPopulation(DominanceComparator,
DuplicateMode) instead. 

NondominatedPopulation(DominanceComparator comparator,
Iterable<? extends Solution> iterable)
Constructs a nondominated population using the specified dominance comparator and initialized with the specified solutions. 

NondominatedPopulation(DominanceComparator comparator,
NondominatedPopulation.DuplicateMode duplicateMode)
Constructs an empty nondominated population using the specified dominance relation. 

NondominatedPopulation(Iterable<? extends Solution> iterable)
Constructs a nondominated population using the Pareto dominance relation and initialized with the specified solutions. 

NondominatedPopulation(NondominatedPopulation.DuplicateMode duplicateMode)
Constructs an empty nondominated population using the Pareto dominance relation. 
Method Summary  

boolean 
add(Solution newSolution)
If newSolution is dominates any solution or is nondominated with
all solutions in this population, the dominated solutions are removed and
newSolution is added to this population. 
protected static double 
distance(Solution s1,
Solution s2)
Returns the Euclidean distance between two solutions in objective space. 
protected boolean 
forceAddWithoutCheck(Solution newSolution)
Adds the specified solution to the population, bypassing the nondomination check. 
DominanceComparator 
getComparator()
Returns the dominance comparator used by this nondominated population. 
protected boolean 
isDuplicate(Solution s1,
Solution s2)
Returns true if the two solutions are duplicates and one should
be ignored based on the duplicate mode. 
void 
replace(int index,
Solution newSolution)
Replace the solution at the given index with the new solution, but only if the new solution is nondominated. 
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 
Field Detail 

protected final DominanceComparator comparator
protected final NondominatedPopulation.DuplicateMode duplicateMode
Constructor Detail 

public NondominatedPopulation()
public NondominatedPopulation(NondominatedPopulation.DuplicateMode duplicateMode)
duplicateMode
 specifies how duplicate solutions are handledpublic NondominatedPopulation(DominanceComparator comparator)
comparator
 the dominance relation used by this nondominated
population@Deprecated public NondominatedPopulation(DominanceComparator comparator, boolean allowDuplicates)
NondominatedPopulation(DominanceComparator,
DuplicateMode)
instead.
comparator
 the dominance relation used by this nondominated
populationallowDuplicates
 allow duplicate solutions into the nondominated
populationpublic NondominatedPopulation(DominanceComparator comparator, NondominatedPopulation.DuplicateMode duplicateMode)
comparator
 the dominance relation used by this nondominated
populationduplicateMode
 specifies how duplicate solutions are handledpublic NondominatedPopulation(Iterable<? extends Solution> iterable)
iterable
 the solutions used to initialize this nondominated
populationpublic NondominatedPopulation(DominanceComparator comparator, Iterable<? extends Solution> iterable)
comparator
 the dominance relation used by this nondominated
populationiterable
 the solutions used to initialize this nondominated
populationMethod Detail 

public boolean add(Solution newSolution)
newSolution
is dominates any solution or is nondominated 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.
add
in class Population
newSolution
 the solution to be added
true
if the population was modified as a result of this
method; false
otherwise.public void replace(int index, Solution newSolution)
replace
in class Population
index
 the index to replacenewSolution
 the new solutionprotected boolean forceAddWithoutCheck(Solution newSolution)
This method should only be used internally, and should never be made public by any subclasses.
newSolution
 the solution to be added
protected static double distance(Solution s1, Solution s2)
s1
 the first solutions2
 the second solution
protected boolean isDuplicate(Solution s1, Solution s2)
true
if the two solutions are duplicates and one should
be ignored based on the duplicate mode. This default implementation
depends on the Object.equals(Object)
method of the Variable
class to check for equality of the decision variables.
s1
 the first solutions2
 the second solution
true
if the solutions are duplicates; false
otherwisepublic DominanceComparator getComparator()

MOEA Framework 2.12 API Specification 

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 