public abstract class SelectionMethod extends BreedingSource
Typical Number of Individuals Produced Per produce(...) call
Always 1.
| Modifier and Type | Field and Description |
|---|---|
static int |
INDS_PRODUCED |
static java.lang.String |
KEY_PARENTS |
NO_PROBABILITY, P_PROB, probability| Constructor and Description |
|---|
SelectionMethod() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
abstract 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.
|
int |
produce(int min,
int max,
int subpopulation,
java.util.ArrayList<Individual> inds,
EvolutionState state,
int thread,
java.util.HashMap<java.lang.String,java.lang.Object> misc)
Produces n individuals from the given subpopulation
and puts them into inds[start...start+n-1],
where n = Min(Max(q,min),max), where q is the "typical" number of
individuals the BreedingSource produces in one shot, and returns
n.
|
boolean |
produces(EvolutionState state,
Population newpop,
int subpopulation,
int thread)
A default version of produces -- this method always returns
true under the assumption that the selection method works
with all Fitnesses.
|
int |
produceWithoutCloning(int min,
int max,
int subpopulation,
java.util.ArrayList<Individual> inds,
EvolutionState state,
int thread,
java.util.HashMap<java.lang.String,java.lang.Object> misc) |
int |
typicalIndsProduced()
Returns 1 (the typical default value)
|
clone, fillStubs, getProbability, pickRandom, preparePipeline, setProbability, setup, setupProbabilitiesequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdefaultBasepublic static final int INDS_PRODUCED
public static final java.lang.String KEY_PARENTS
public int typicalIndsProduced()
typicalIndsProduced in class BreedingSourcepublic boolean produces(EvolutionState state, Population newpop, int subpopulation, int thread)
produces in class BreedingSourcepublic void prepareToProduce(EvolutionState s, int subpopulation, int thread)
prepareToProduce in class BreedingSourcepublic void finishProducing(EvolutionState s, int subpopulation, int thread)
finishProducing in class BreedingSourcepublic final int produce(int min,
int max,
int subpopulation,
java.util.ArrayList<Individual> inds,
EvolutionState state,
int thread,
java.util.HashMap<java.lang.String,java.lang.Object> misc)
BreedingSourceproduce in class BreedingSourcepublic int produceWithoutCloning(int min,
int max,
int subpopulation,
java.util.ArrayList<Individual> inds,
EvolutionState state,
int thread,
java.util.HashMap<java.lang.String,java.lang.Object> misc)
public abstract int produce(int subpopulation,
EvolutionState state,
int thread)