R
- The Result Type of the engine (f.i. NAryTree
or a
ParetoFront
of these
trees.public abstract class LoggingEvolutionEngine<R> extends GenerationalEvolutionEngine<NAryTree>
Modifier and Type | Field and Description |
---|---|
protected CentralRegistry |
centralRegistry |
protected int |
generation |
protected ETMParamAbstract<R> |
params |
evolutionScheme, fitnessEvaluator, selectionStrategy
candidateFactory, rng, satisfiedTerminationConditions
Constructor and Description |
---|
LoggingEvolutionEngine(ETMParamAbstract<R> params) |
Modifier and Type | Method and Description |
---|---|
protected java.util.List<EvaluatedCandidate<NAryTree>> |
evaluatePopulation(java.util.List<NAryTree> population)
Takes a population, assigns a fitness score to each member and returns
the members with their scores attached, sorted in descending order of
fitness (descending order of fitness score for natural scores, ascending
order of scores for non-natural scores).
|
NAryTree |
evolve() |
java.util.List<EvaluatedCandidate<NAryTree>> |
evolvePopulation() |
int |
getGeneration()
Returns the last completed generation
|
int |
getLogModulo()
Get after how many generations a full population log should be written
|
void |
logPopulation(java.util.List<EvaluatedCandidate<NAryTree>> result) |
abstract java.lang.String |
logResult(java.util.List<EvaluatedCandidate<NAryTree>> result)
Write the current result to a file, should be implemented by each
specific engine
|
void |
setCentralRegistry(CentralRegistry registry) |
void |
setLogModulo(int logModulo)
Set after how many generations a full population log should be written
|
void |
setParameterObject(ETMParamAbstract<R> params)
Gives the engine a reference to the parameter object if not done so
already in the constructor
|
nextEvolutionStep
addEvolutionObserver, evolve, evolve, evolvePopulation, evolvePopulation, getSatisfiedTerminationConditions, notifyPopulationChange, removeEvolutionObserver, setSingleThreaded
protected CentralRegistry centralRegistry
protected int generation
protected ETMParamAbstract<R> params
public LoggingEvolutionEngine(ETMParamAbstract<R> params)
public NAryTree evolve()
public java.util.List<EvaluatedCandidate<NAryTree>> evolvePopulation()
protected java.util.List<EvaluatedCandidate<NAryTree>> evaluatePopulation(java.util.List<NAryTree> population)
AbstractEvolutionEngine
evaluatePopulation
in class AbstractEvolutionEngine<NAryTree>
population
- The population to evaluate (each candidate is assigned a
fitness score).public void logPopulation(java.util.List<EvaluatedCandidate<NAryTree>> result)
public abstract java.lang.String logResult(java.util.List<EvaluatedCandidate<NAryTree>> result)
cand
- public int getGeneration()
public void setCentralRegistry(CentralRegistry registry)
public int getLogModulo()
public void setLogModulo(int logModulo)
logModulo
- the logModulo to setpublic void setParameterObject(ETMParamAbstract<R> params)
params
-