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, setupProbabilities
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
defaultBase
public static final int INDS_PRODUCED
public static final java.lang.String KEY_PARENTS
public int typicalIndsProduced()
typicalIndsProduced
in class BreedingSource
public boolean produces(EvolutionState state, Population newpop, int subpopulation, int thread)
produces
in class BreedingSource
public void prepareToProduce(EvolutionState s, int subpopulation, int thread)
prepareToProduce
in class BreedingSource
public void finishProducing(EvolutionState s, int subpopulation, int thread)
finishProducing
in class BreedingSource
public 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)
BreedingSource
produce
in class BreedingSource
public 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)