Package ec.select
Class FitProportionateSelection
java.lang.Object
ec.BreedingSource
ec.SelectionMethod
ec.select.FitProportionateSelection
- All Implemented Interfaces:
Prototype,Setup,RandomChoiceChooserD,Serializable,Cloneable
- Direct Known Subclasses:
BoltzmannSelection,SigmaScalingSelection
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
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptiondouble[]Normalized, totalized fitnesses for the populationstatic final StringDefault baseFields inherited from class ec.SelectionMethod
INDS_PRODUCED, KEY_PARENTSFields inherited from class ec.BreedingSource
NO_PROBABILITY, P_PROB, probability -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the default base for this prototype.voidfinishProducing(EvolutionState s, int subpopulation, int thread) A default version of finishProducing, which does nothing.voidprepareToProduce(EvolutionState s, int subpopulation, int thread) A default version of prepareToProduce which does nothing.intproduce(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
produce, produces, produceWithoutCloning, typicalIndsProducedMethods inherited from class ec.BreedingSource
clone, fillStubs, getProbability, pickRandom, preparePipeline, setProbability, setup, setupProbabilities
-
Field Details
-
P_FITNESSPROPORTIONATE
Default base- See Also:
-
fitnesses
public double[] fitnessesNormalized, totalized fitnesses for the population
-
-
Constructor Details
-
FitProportionateSelection
public FitProportionateSelection()
-
-
Method Details
-
defaultBase
Description copied from interface:PrototypeReturns the default base for this prototype. This should generally be implemented by building off of the static base() method on the DefaultsForm object for the prototype's package. This should be callable during setup(...). -
prepareToProduce
Description copied from class:SelectionMethodA default version of prepareToProduce which does nothing.- Overrides:
prepareToProducein classSelectionMethod
-
produce
Description copied from class:SelectionMethodAn alternative form of "produce" special to Selection Methods; selects an individual from the given subpopulation and returns its position in that subpopulation.- Specified by:
producein classSelectionMethod
-
finishProducing
Description copied from class:SelectionMethodA default version of finishProducing, which does nothing.- Overrides:
finishProducingin classSelectionMethod
-