public class EditDistanceWrapperRTEDAbsolute extends TreeFitnessAbstract
Modifier and Type | Class and Description |
---|---|
static class |
EditDistanceWrapperRTEDAbsolute.EditDistanceWrapperRTEDAbsoluteGUI |
TreeFitnessAbstract.TreeFitnessGUISettingsAbstract<F extends TreeFitnessAbstract>, TreeFitnessAbstract.TreeFitnessGUISettingsEmpty<F extends TreeFitnessAbstract>
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap<util.LblTree,java.lang.Integer> |
baseTrees |
protected boolean |
beAbsolute |
protected util.LblTree |
bestTree |
static TreeFitnessInfo |
info |
protected double |
lastBestDist |
protected double |
limit |
Constructor and Description |
---|
EditDistanceWrapperRTEDAbsolute(java.util.Collection<NAryTree> base)
Instantiate the edit distance metric with the given set of base trees
|
EditDistanceWrapperRTEDAbsolute(EditDistanceWrapperRTEDAbsolute original) |
EditDistanceWrapperRTEDAbsolute(NAryTree baseTree) |
EditDistanceWrapperRTEDAbsolute(NAryTree[] base) |
Modifier and Type | Method and Description |
---|---|
util.LblTree |
getBestTree()
Returns the tree to which the last call of
#getFitness(Tree, List) was measured against. |
static double |
getDistance(util.LblTree base,
util.LblTree candidate)
Returns the edit distance between the two provided trees using the RTED
library (see class javadoc).
|
double |
getFitness(NAryTree candidate,
java.util.List<? extends NAryTree> population)
Calculates a fitness score for the given candidate.
|
static EditDistanceWrapperRTEDAbsolute.EditDistanceWrapperRTEDAbsoluteGUI |
getGUISettingsPanel(ETMParamAbstract param) |
TreeFitnessInfo |
getInfo()
Returns the STATIC info for the metric instance
|
double |
getLastBestDist()
Returns the best (lowest) edit distance obtained in the last
#getFitness() call. |
double |
getLimit()
Returns the currently set limit after which a very bad fitness will be
returned
|
void |
resetLimit()
Resets the max number of edits allowed to go back to relative mode
|
void |
setLimit(double limit)
Set the limit of edits.
|
util.LblTree |
toLblTree(NAryTree tree) |
util.LblTree |
toLblTree(NAryTree tree,
int n) |
deepClone, deepClone, instantiateTreeFitness, isNatural
public static final TreeFitnessInfo info
protected java.util.HashMap<util.LblTree,java.lang.Integer> baseTrees
protected util.LblTree bestTree
protected double limit
protected boolean beAbsolute
protected double lastBestDist
public EditDistanceWrapperRTEDAbsolute(java.util.Collection<NAryTree> base)
base
- public EditDistanceWrapperRTEDAbsolute(NAryTree[] base)
public EditDistanceWrapperRTEDAbsolute(NAryTree baseTree)
public EditDistanceWrapperRTEDAbsolute(EditDistanceWrapperRTEDAbsolute original)
public double getFitness(NAryTree candidate, java.util.List<? extends NAryTree> population)
FitnessEvaluator
FitnessEvaluator.isNatural()
). This method must always
return a value greater than or equal to zero. Framework behaviour is
undefined for negative fitness scores.candidate
- The candidate solution to calculate fitness for.population
- The entire population. This will include the specified
candidate. This is provided for fitness evaluators that
evaluate individuals in the context of the population that
they are part of (e.g. a program that evolves game-playing
strategies may wish to play each strategy against each of the
others). This parameter can be ignored by simple fitness
evaluators. When iterating over the population, a simple
reference equality check (==) can be used to identify which
member of the population is the specified candidate.public static double getDistance(util.LblTree base, util.LblTree candidate)
base
- candidate
- public util.LblTree toLblTree(NAryTree tree)
public util.LblTree toLblTree(NAryTree tree, int n)
public util.LblTree getBestTree()
#getFitness(Tree, List)
was measured against. This is the tree
that resulted in the best fitness value.public void setLimit(double limit)
public double getLimit()
public void resetLimit()
public double getLastBestDist()
#getFitness()
call.public TreeFitnessInfo getInfo()
getInfo
in class TreeFitnessAbstract
public static EditDistanceWrapperRTEDAbsolute.EditDistanceWrapperRTEDAbsoluteGUI getGUISettingsPanel(ETMParamAbstract param)