ec.select
Class FitProportionateSelection
java.lang.Object
|
+--ec.BreedingSource
|
+--ec.SelectionMethod
|
+--ec.select.FitProportionateSelection
- All Implemented Interfaces:
- java.lang.Cloneable, Prototype, RandomChoiceChooser, java.io.Serializable, Setup
- public class FitProportionateSelection
- extends SelectionMethod
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.
Typical Number of Individuals Produced Per produce(...) call
Always 1.
Default Base
select.fitness-proportionate
- See Also:
- Serialized Form
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
P_FITNESSPROPORTIONATE
public static final java.lang.String P_FITNESSPROPORTIONATE
- Default base
CHECKBOUNDARY
public static final int CHECKBOUNDARY
- CheckBoundary is 8
sortedFit
public float[] sortedFit
- Sorted, normalized, totalized fitnesses for the population
FitProportionateSelection
public FitProportionateSelection()
defaultBase
public Parameter defaultBase()
- Description copied from interface:
Prototype
- Returns 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
public void prepareToProduce(EvolutionState s,
int subpopulation,
int thread)
- Description copied from class:
SelectionMethod
- A default version of prepareToProduce which does nothing.
- Overrides:
prepareToProduce
in class SelectionMethod
produce
public int produce(int subpopulation,
EvolutionState state,
int thread)
- Description copied from class:
SelectionMethod
- An alternative form of "produce" special to Selection Methods;
selects an individual from the given subpopulation and
returns its position in that subpopulation.
- Overrides:
produce
in class SelectionMethod
finishProducing
public void finishProducing(EvolutionState s,
int subpopulation,
int thread)
- Description copied from class:
SelectionMethod
- A default version of finishProducing, which does nothing.
- Overrides:
finishProducing
in class SelectionMethod