|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectec.BreedingSource
ec.SelectionMethod
ec.select.FitProportionateSelection
public class FitProportionateSelection
Picks individuals in a population in direct proportion to their fitnesses as returned by their fitness() methods. This is expensive to set up and bring down, so it's not appropriate for steady-state evolution. If you're not familiar with the relative advantages of selection methods and just want a good one, use TournamentSelection instead. Not appropriate for multiobjective fitnesses.
Note: Fitnesses must be non-negative. 0 is assumed to be the worst fitness.
Typical Number of Individuals Produced Per produce(...) call
Always 1.
Default Base
select.fitness-proportionate
Field Summary | |
---|---|
static java.lang.String |
P_FITNESSPROPORTIONATE
Default base |
float[] |
sortedFit
Sorted, normalized, totalized fitnesses for the population |
Fields inherited from class ec.SelectionMethod |
---|
INDS_PRODUCED |
Fields inherited from class ec.BreedingSource |
---|
CHECKBOUNDARY, DEFAULT_PRODUCED, NO_PROBABILITY, P_PROB, probability, UNUSED |
Constructor Summary | |
---|---|
FitProportionateSelection()
|
Method Summary | |
---|---|
Parameter |
defaultBase()
Returns the default base for this prototype. |
void |
finishProducing(EvolutionState s,
int subpopulation,
int thread)
A default version of finishProducing, which does nothing. |
void |
prepareToProduce(EvolutionState s,
int subpopulation,
int thread)
A default version of prepareToProduce which does nothing. |
int |
produce(int subpopulation,
EvolutionState state,
int thread)
An alternative form of "produce" special to Selection Methods; selects an individual from the given subpopulation and returns its position in that subpopulation. |
Methods inherited from class ec.SelectionMethod |
---|
preparePipeline, produce, produces, typicalIndsProduced |
Methods inherited from class ec.BreedingSource |
---|
clone, getProbability, pickRandom, setProbability, setup, setupProbabilities |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String P_FITNESSPROPORTIONATE
public float[] sortedFit
Constructor Detail |
---|
public FitProportionateSelection()
Method Detail |
---|
public Parameter defaultBase()
Prototype
public void prepareToProduce(EvolutionState s, int subpopulation, int thread)
SelectionMethod
prepareToProduce
in class SelectionMethod
public int produce(int subpopulation, EvolutionState state, int thread)
SelectionMethod
produce
in class SelectionMethod
public void finishProducing(EvolutionState s, int subpopulation, int thread)
SelectionMethod
finishProducing
in class SelectionMethod
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |