Class TarpeianStatistics
- All Implemented Interfaces:
Setup,Singleton,Serializable
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) |
- See Also:
-
Field Summary
FieldsFields inherited from class ec.Statistics
children, P_CHILD, P_MUZZLE, P_NUMCHILDREN, P_SILENT, P_SILENT_FILE, P_SILENT_PRINT, silentFile, silentPrint -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidMarks a proportion (killProportion) of individuals with above-average size (within their own subpopulation) to a minimum value.voidsetMinimumFitness(EvolutionState state, int subpopulation, Individual ind) Sets the fitness of an individual to the minimum fitness possible.voidsetup(EvolutionState state, Parameter base) Sets up the object by reading it from the parameters stored in state, built off of the parameter base base.Methods inherited from class ec.Statistics
enteringInitialPopulationStatistics, enteringSteadyStateStatistics, finalStatistics, generationBoundaryStatistics, individualsBredStatistics, individualsEvaluatedStatistics, postBreedingStatistics, postCheckpointStatistics, postEvaluationStatistics, postInitializationStatistics, postPostBreedingExchangeStatistics, postPreBreedingExchangeStatistics, preBreedingStatistics, preCheckpointStatistics, preInitializationStatistics, prePostBreedingExchangeStatistics, prePreBreedingExchangeStatistics
-
Field Details
-
P_KILL_PROPORTION
one in n individuals are killed- See Also:
-
-
Constructor Details
-
TarpeianStatistics
public TarpeianStatistics()
-
-
Method Details
-
setup
Description copied from interface:SetupSets up the object by reading it from the parameters stored in state, built off of the parameter base base. If an ancestor implements this method, be sure to call super.setup(state,base); before you do anything else.- Specified by:
setupin interfaceSetup- Overrides:
setupin classStatistics
-
preEvaluationStatistics
Marks a proportion (killProportion) of individuals with above-average size (within their own subpopulation) to a minimum value.- Overrides:
preEvaluationStatisticsin classStatistics
-
setMinimumFitness
Sets the fitness of an individual to the minimum fitness possible. If the fitness is of type ec.simple.SimpleFitness, that minimum value is -Double.MAX_VALUE; If the fitness is of type ec.gp.koza.KozaFitness, that minimum value is Double.MAX_VALUE; Else, a fatal error is reported. You need to override this method if you're using any other type of fitness.
-