public class ParetoFront
extends java.lang.Object
Constructor and Description |
---|
ParetoFront(CentralRegistry registry,
int maxSize,
java.util.List<TreeFitnessInfo> dimensions)
Constructor of the Pareto front with a link to the central registry and
the dimensions to consider
|
ParetoFront(CentralRegistry registry,
int maxSize,
TreeFitnessInfo[] dimensions)
Constructor of the Pareto front with a link to the central registry and
the dimensions to consider
|
ParetoFront(CentralRegistry registry,
java.util.List<TreeFitnessInfo> dimensions)
Constructor of the Pareto front with a link to the central registry and
the dimensions to consider
|
ParetoFront(CentralRegistry registry,
TreeFitnessInfo[] dimensions)
Constructor of the Pareto front with a link to the central registry and
the dimensions to consider
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkConsistency()
Utility function used for debugging to check the internal registries of
the Pareto Front for consistency
|
double |
compareOnDimension(NAryTree t1,
NAryTree t2,
TreeFitnessInfo dimension)
Returns the difference between the two trees in the given dimension,
taken into account whether bigger is better or worse.
|
void |
consider(java.util.Collection<NAryTree> trees)
Considers adding the provided collection of trees to the Pareto front.
|
boolean |
consider(NAryTree t)
Consider adding the provided tree to the Pareto front.
|
int |
countDominatorsOf(NAryTree t)
Returns the number of trees in the current Pareto front that dominate the
given tree
|
boolean |
dominates(NAryTree t,
NAryTree candidate)
Returns TRUE if tree t dominates tree candidate.
|
boolean |
dominates(NAryTree t1,
NAryTree t2,
boolean requireStrictlyBetter)
Returns TRUE if tree t1 dominates t2.
|
NAryTree |
getBest(TreeFitnessInfo dimension)
Returns the best tree in the given dimension
|
NAryTree |
getBetter(TreeFitnessInfo dimension,
NAryTree tree)
Returns the tree next to the given tree which is slightly better in the
given dimension
|
TreeFitnessInfo[] |
getDimensions()
Returns an array of the dimensions considered
|
ParetoFront |
getFilteredFront(java.util.HashMap<TreeFitnessInfo,java.lang.Double> upperLimits,
java.util.HashMap<TreeFitnessInfo,java.lang.Double> lowerLimits)
Returns a Pareto front instance with only those members that are
currently in this Pareto front and are in between the provided limits.
|
java.util.Collection<NAryTree> |
getFront()
Return the complete Pareto front
|
ParetoFront |
getFrontForDimensions(TreeFitnessInfo[] dimensions)
Returns a Pareto Front instance with only those members that are
currently in this Pareto front that also form a Pareto Front on a subset
of these dimensions.
|
double |
getLowerLimit(TreeFitnessInfo dimension)
Returns the current lower limit for the given dimension
|
int |
getMaxSize() |
int |
getNrBetter(TreeFitnessInfo dimension,
NAryTree tree)
Returns the number of trees that for the given dimension are better
|
int |
getNrWorse(TreeFitnessInfo dimension,
NAryTree tree)
Returns the number of trees that for the given dimension are worse
|
CentralRegistry |
getRegistry()
To be able to get the fitness values for the trees while visualising the
Pareto front
|
java.util.Set<NAryTree> |
getTreeWithValues(java.util.HashMap<TreeFitnessInfo,java.lang.Double> values)
Returns all trees currently in the Pareto Front with the specified values
for the dimensions (e.g.
|
double |
getUpperLimit(TreeFitnessInfo dimension)
Returns the current upper limit for the given dimension
|
NAryTree |
getWorse(TreeFitnessInfo dimension,
NAryTree tree)
Returns the tree next to the given tree which is slightly worse in the
given dimension
|
NAryTree |
getWorst(TreeFitnessInfo dimension)
Returns the worst tree in the given dimension
|
boolean |
inParetoFront(NAryTree tree)
Checks whether the given tree is in the Pareto front
|
void |
lockTree(NAryTree tree)
Locks the provided tree, meaning that it will not be removed from the
Pareto front during the lock
|
void |
reduceSize() |
void |
reEvaluateParetoFitness()
Re-Evaluates all trees in the front and updates their overall fitness
value using the
ParetoFitnessEvaluator relative distance. |
void |
setMaxSize(int maxSize) |
boolean |
shouldBeRemovedButIsLocked(NAryTree tree) |
int |
size()
Returns the size of the Pareto front (e.g.
|
java.lang.String |
toString()
Returns a string representation of the Pareto front
|
boolean |
unlockTree(NAryTree tree)
Unlocks the provided tree, allowing it to be deleted.
|
boolean |
updateLowerLimit(TreeFitnessInfo dimension,
double limit)
Set a new lower limit for the given dimension.
|
boolean |
updateUpperLimit(TreeFitnessInfo dimension,
double limit)
Set a new upper limit for the given dimension.
|
public ParetoFront(CentralRegistry registry, java.util.List<TreeFitnessInfo> dimensions)
registry
- CentralRegistry instancedimensions
- List of dimensions to considerpublic ParetoFront(CentralRegistry registry, int maxSize, java.util.List<TreeFitnessInfo> dimensions)
registry
- CentralRegistry instancemaxSize
- Maximum size of the Pareto Frontdimensions
- List of dimensions to considerpublic ParetoFront(CentralRegistry registry, TreeFitnessInfo[] dimensions)
registry
- CentralRegistry instancedimensions
- Array of dimensions to considerpublic ParetoFront(CentralRegistry registry, int maxSize, TreeFitnessInfo[] dimensions)
registry
- CentralRegistry instancemaxSize
- Maximum size of the Pareto Frontdimensions
- Array of dimensions to considerpublic void consider(java.util.Collection<NAryTree> trees)
trees
- Collection of treespublic void reEvaluateParetoFitness()
ParetoFitnessEvaluator
relative distance.public boolean consider(NAryTree t)
t
- Tree to consider addingpublic double compareOnDimension(NAryTree t1, NAryTree t2, TreeFitnessInfo dimension)
t1
- First treet2
- Second treedimension
- TreeFitnessInfo instance of the dimension to checkpublic int countDominatorsOf(NAryTree t)
t
- public boolean dominates(NAryTree t, NAryTree candidate)
t
- candidate
- public boolean dominates(NAryTree t1, NAryTree t2, boolean requireStrictlyBetter)
t1
- NAryTree to be tested if it dominates the other treet2
- NAryTree second tree to be tested for dominance by trequireStrictlyBetter
- Boolean to indicate if we require at least one dimension to be
strictly better (if false then equal is also good enough)public int size()
public java.util.Collection<NAryTree> getFront()
public NAryTree getWorst(TreeFitnessInfo dimension)
dimension
- Dimension infopublic NAryTree getBest(TreeFitnessInfo dimension)
dimension
- Dimension infopublic NAryTree getWorse(TreeFitnessInfo dimension, NAryTree tree)
dimension
- Dimension Infotree
- Tree to use as referencepublic NAryTree getBetter(TreeFitnessInfo dimension, NAryTree tree)
dimension
- Dimension infotree
- Tree to use as referencepublic int getNrBetter(TreeFitnessInfo dimension, NAryTree tree)
dimension
- Dimension infotree
- Reference treepublic int getNrWorse(TreeFitnessInfo dimension, NAryTree tree)
dimension
- Dimension infotree
- Reference treepublic boolean checkConsistency()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean updateUpperLimit(TreeFitnessInfo dimension, double limit)
dimension
- Dimension to update upper limit forlimit
- New upper limitpublic boolean updateLowerLimit(TreeFitnessInfo dimension, double limit)
dimension
- Dimension to update lower limit forlimit
- New lower limitpublic double getLowerLimit(TreeFitnessInfo dimension)
dimension
- Dimension to get the lower limit forpublic double getUpperLimit(TreeFitnessInfo dimension)
dimension
- Dimension to get the upper limit forpublic void lockTree(NAryTree tree)
tree
- public boolean unlockTree(NAryTree tree)
tree
- Tree to unlockpublic boolean inParetoFront(NAryTree tree)
tree
- NAryTree to check for Pareto front inclusionpublic boolean shouldBeRemovedButIsLocked(NAryTree tree)
public CentralRegistry getRegistry()
public TreeFitnessInfo[] getDimensions()
public java.util.Set<NAryTree> getTreeWithValues(java.util.HashMap<TreeFitnessInfo,java.lang.Double> values)
values
- public ParetoFront getFrontForDimensions(TreeFitnessInfo[] dimensions)
dimensions
- public ParetoFront getFilteredFront(java.util.HashMap<TreeFitnessInfo,java.lang.Double> upperLimits, java.util.HashMap<TreeFitnessInfo,java.lang.Double> lowerLimits)
upperLimits
- lowerLimits
- public void reduceSize()
public int getMaxSize()
public void setMaxSize(int maxSize)
maxSize
- the maxSize of the Pareto Front to set