public abstract class EvolutionStatistics<C extends Comparable<? super C>,FitnessStatistics> extends Object implements Consumer<EvolutionResult<?,C>>
final Engine<DoubleGene, Double> engine = ...
final EvolutionStatistics<Double, DoubleMomentStatistics> statistics =
EvolutionStatistics.ofNumber();
final Phenotype<DoubleGene, Double> result = engine.stream()
.limit(bySteadyFitness(7))
.limit(100)
.peek(statistics)
.collect(toBestPhenotype());
System.println(statistics);
+---------------------------------------------------------------------------+
| Time statistics |
+---------------------------------------------------------------------------+
| Selection: sum=0.046538278000 s; mean=0.003878189833 s |
| Altering: sum=0.086155457000 s; mean=0.007179621417 s |
| Fitness calculation: sum=0.022901606000 s; mean=0.001908467167 s |
| Overall execution: sum=0.147298067000 s; mean=0.012274838917 s |
+---------------------------------------------------------------------------+
| Evolution statistics |
+---------------------------------------------------------------------------+
| Generations: 12 |
| Altered: sum=7,331; mean=610.916666667 |
| Killed: sum=0; mean=0.000000000 |
| Invalids: sum=0; mean=0.000000000 |
+---------------------------------------------------------------------------+
| Population statistics |
+---------------------------------------------------------------------------+
| Age: max=11; mean=1.951000; var=5.545190 |
| Fitness: |
| min = 0.000000000000 |
| max = 481.748227114537 |
| mean = 384.430345078660 |
| var = 13006.132537301528 |
| std = 114.044432 |
+---------------------------------------------------------------------------+
Modifier and Type | Method and Description |
---|---|
void |
accept(EvolutionResult<?,C> result) |
DoubleMomentStatistics |
alterDuration()
Return the duration statistics needed for altering the population, in
seconds.
|
IntMomentStatistics |
altered()
Return the statistics about the altered individuals during the evolution
process.
|
DoubleMomentStatistics |
evaluationDuration()
Return the duration statistics needed for evaluating the fitness function
of the new individuals, in seconds.
|
DoubleMomentStatistics |
evolveDuration()
Return the duration statistics needed for the whole evolve step, in
seconds.
|
FitnessStatistics |
fitness()
Return the minimal and maximal fitness.
|
DoubleMomentStatistics |
getAlterDuration()
Deprecated.
Use
alterDuration() instead |
IntMomentStatistics |
getAltered()
Deprecated.
Use
altered() instead |
DoubleMomentStatistics |
getEvaluationDuration()
Deprecated.
Use
evaluationDuration() instead |
DoubleMomentStatistics |
getEvolveDuration()
Deprecated.
Use
evaluationDuration() instead |
FitnessStatistics |
getFitness()
Deprecated.
Use
fitness() instead |
IntMomentStatistics |
getInvalids()
Deprecated.
Use
invalids() instead |
IntMomentStatistics |
getKilled()
Deprecated.
Use
killed() instead |
LongMomentStatistics |
getPhenotypeAge()
Deprecated.
Use
phenotypeAge() instead |
DoubleMomentStatistics |
getSelectionDuration()
Deprecated.
Use
selectionDuration() instead |
IntMomentStatistics |
invalids()
Return the statistics about the invalid individuals during the evolution
process.
|
IntMomentStatistics |
killed()
Return the statistics about the killed individuals during the evolution
process.
|
static <C extends Comparable<? super C>> |
ofComparable() |
static <N extends Number & Comparable<? super N>> |
ofNumber() |
LongMomentStatistics |
phenotypeAge()
Return the statistics about the individuals age.
|
DoubleMomentStatistics |
selectionDuration()
Return the duration statistics needed for selecting the population, in
seconds.
|
String |
toString() |
public void accept(EvolutionResult<?,C> result)
accept
in interface Consumer<EvolutionResult<?,C extends Comparable<? super C>>>
public DoubleMomentStatistics selectionDuration()
@Deprecated public DoubleMomentStatistics getSelectionDuration()
selectionDuration()
insteadpublic DoubleMomentStatistics alterDuration()
@Deprecated public DoubleMomentStatistics getAlterDuration()
alterDuration()
insteadpublic DoubleMomentStatistics evaluationDuration()
@Deprecated public DoubleMomentStatistics getEvaluationDuration()
evaluationDuration()
insteadpublic DoubleMomentStatistics evolveDuration()
@Deprecated public DoubleMomentStatistics getEvolveDuration()
evaluationDuration()
insteadpublic IntMomentStatistics killed()
@Deprecated public IntMomentStatistics getKilled()
killed()
insteadpublic IntMomentStatistics invalids()
@Deprecated public IntMomentStatistics getInvalids()
invalids()
insteadpublic IntMomentStatistics altered()
@Deprecated public IntMomentStatistics getAltered()
altered()
insteadpublic LongMomentStatistics phenotypeAge()
@Deprecated public LongMomentStatistics getPhenotypeAge()
phenotypeAge()
insteadpublic FitnessStatistics fitness()
@Deprecated public FitnessStatistics getFitness()
fitness()
insteadpublic static <C extends Comparable<? super C>> EvolutionStatistics<C,MinMax<C>> ofComparable()
public static <N extends Number & Comparable<? super N>> EvolutionStatistics<N,DoubleMomentStatistics> ofNumber()
© 2007-2020 Franz Wilhelmstötter (2020-02-18 20:01)