public class TarpeianStatistics extends Statistics
Different Fitnesses have different meanings of the word "bad". At present, we set the fitness to -Double.MAX_VALUE if it's a SimpleFitness, and set it to Double.MAX_VALUE if it's a KozaFitnesss. If it's any other kind of Fitness, an error is reported. You can override the "bad-setter" function setMinimumFitness(...) to make other kinds of fitness bad in different ways. In the future we may revisit how to set Fitnesses to "bad" in a more general way if this becomes an issue.
Tarpeian is implemented as a Statistics. Why? Because we need to mark individuals as evaluated prior to the Evaluator getting to them, and also need to keep track of the total proportion marked as such. We considered doing this as a SelectionMethod, as a BreedingPipeline, as a Breeder, and as an Evaluator. None are good options really -- Evaluator is the best approach but it means we have special Tarpeian Evaluators, so it's no longer orthogonal with other Evaluators. Eventually we settled on the one object which has the right hooks and can be easily stuck onto the system without modifying anything in a special-purpose way: a Statistics object.
All you need to do is add TarpeianStatistics as a child to your existing Statistics chain. If you have one existing Statistics, then you just add the parameters stat.num-children=1 and stat.child.0=ec.parsimony.TarpeianStatistics You'll also need to specify the kill proportion (for example, stat.child.0.kill-proportion=0.2 )
Parameters
base.kill-proportion 0 < int < 1 |
(proportion of above-average-sized individuals killed) |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
P_KILL_PROPORTION
one in n individuals are killed
|
children, P_CHILD, P_MUZZLE, P_NUMCHILDREN, P_SILENT, P_SILENT_FILE, P_SILENT_PRINT, silentFile, silentPrint
Constructor and Description |
---|
TarpeianStatistics() |
Modifier and Type | Method and Description |
---|---|
void |
preEvaluationStatistics(EvolutionState state)
Marks a proportion (killProportion) of individuals with above-average size (within their own subpopulation) to a minimum value.
|
void |
setMinimumFitness(EvolutionState state,
int subpopulation,
Individual ind)
Sets the fitness of an individual to the minimum fitness possible.
|
void |
setup(EvolutionState state,
Parameter base)
Sets up the object by reading it from the parameters stored
in state, built off of the parameter base base.
|
enteringInitialPopulationStatistics, enteringSteadyStateStatistics, finalStatistics, generationBoundaryStatistics, individualsBredStatistics, individualsEvaluatedStatistics, postBreedingStatistics, postCheckpointStatistics, postEvaluationStatistics, postInitializationStatistics, postPostBreedingExchangeStatistics, postPreBreedingExchangeStatistics, preBreedingStatistics, preCheckpointStatistics, preInitializationStatistics, prePostBreedingExchangeStatistics, prePreBreedingExchangeStatistics
public static final java.lang.String P_KILL_PROPORTION
public void setup(EvolutionState state, Parameter base)
Setup
setup
in interface Setup
setup
in class Statistics
public void preEvaluationStatistics(EvolutionState state)
preEvaluationStatistics
in class Statistics
public void setMinimumFitness(EvolutionState state, int subpopulation, Individual ind)