|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectec.Statistics
ec.parsimony.TarpeianStatistics
public class TarpeianStatistics
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 -Float.MAX_VALUE if it's a SimpleFitness, and set it to Float.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) |
Field Summary | |
---|---|
static java.lang.String |
P_KILL_PROPORTION
one in n individuals are killed |
Fields inherited from class ec.Statistics |
---|
children, P_CHILD, P_NUMCHILDREN |
Constructor Summary | |
---|---|
TarpeianStatistics()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String P_KILL_PROPORTION
Constructor Detail |
---|
public TarpeianStatistics()
Method Detail |
---|
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)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |