|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ec.BreedingSource | +--ec.SelectionMethod | +--ec.select.BestSelection
Picks among the best n individuals in a population in direct proportion to their absolute fitnesses as returned by their fitness() methods relative to the fitnesses of the other "best" individuals in that n. 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.
Parameters
base.pick-worst bool = true or false (default) |
(should we pick from among the worst n individuals in the tournament instead of the best n?) |
Default Base
select.best
Field Summary | |
int |
bestn
|
static int |
CHECKBOUNDARY
CheckBoundary is 8 |
static java.lang.String |
P_BEST
Default base |
static java.lang.String |
P_N
|
static java.lang.String |
P_PICKWORST
|
boolean |
pickWorst
Do we pick the worst instead of the best? |
float[] |
sortedFit
Sorted, normalized, totalized fitnesses for the population |
int[] |
sortedPop
Sorted population -- since I *have* to use an int-sized individual (short gives me only 16K), I might as well just have pointers to the population itself. |
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 | |
BestSelection()
|
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. |
void |
setup(EvolutionState state,
Parameter base)
Sets up the BreedingPipeline. |
Methods inherited from class ec.SelectionMethod |
preparePipeline,
produce,
produces,
typicalIndsProduced |
Methods inherited from class ec.BreedingSource |
getProbability,
pickRandom,
protoClone,
protoCloneSimple,
setProbability,
setupProbabilities |
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_BEST
public static final java.lang.String P_N
public static final java.lang.String P_PICKWORST
public static final int CHECKBOUNDARY
public float[] sortedFit
public int[] sortedPop
public boolean pickWorst
public int bestn
Constructor Detail |
public BestSelection()
Method Detail |
public Parameter defaultBase()
public void setup(EvolutionState state, Parameter base)
The most common modification is to normalize it with some other set of probabilities, then set all of them up in increasing summation; this allows the use of the fast static BreedingSource-picking utility method, BreedingSource.pickRandom(...). In order to use this method, for example, if four breeding source probabilities are {0.3, 0.2, 0.1, 0.4}, then they should get normalized and summed by the outside owners as: {0.3, 0.5, 0.6, 1.0}.
Prototype.setup(EvolutionState,Parameter)
public void prepareToProduce(EvolutionState s, int subpopulation, int thread)
public int produce(int subpopulation, EvolutionState state, int thread)
public void finishProducing(EvolutionState s, int subpopulation, int thread)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |