Class TarpeianStatistics
- java.lang.Object
-
- ec.Statistics
-
- ec.parsimony.TarpeianStatistics
-
public class TarpeianStatistics extends Statistics
This Statistics subclass implements Poli's "Tarpeian" method of parsimony control, whereby some kill-proportion of above-average-sized individuals in each subpopulation have their fitnesses set to a very bad value, and marks them as already evaluated (so the Evaluator can skip them). The specific individuals in this proportion is determined at random.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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringP_KILL_PROPORTIONone in n individuals are killed-
Fields 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 Constructor and Description TarpeianStatistics()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidpreEvaluationStatistics(EvolutionState state)Marks 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 Detail
-
P_KILL_PROPORTION
public static final java.lang.String P_KILL_PROPORTION
one in n individuals are killed- See Also:
- Constant Field Values
-
-
Method Detail
-
setup
public void setup(EvolutionState state, Parameter base)
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
public void preEvaluationStatistics(EvolutionState state)
Marks a proportion (killProportion) of individuals with above-average size (within their own subpopulation) to a minimum value.- Overrides:
preEvaluationStatisticsin classStatistics
-
setMinimumFitness
public void setMinimumFitness(EvolutionState state, int subpopulation, Individual ind)
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.
-
-
DMelt 3.0 © DataMelt by jWork.ORG