public class StubPipeline extends ReproductionPipeline
Typical Number of Individuals Produced Per produce(...) call
...as many as the child produces
Number of Sources
1
Parameters
base.stub-source classname, inherits and != ec.BreedingSource |
(the prototypical "stub pipeline" Breeding Source) |
Parameter bases
base.stub-source | i_prototype (the stub pipeline) |
Default Base
breed.stub
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
P_STUB |
static java.lang.String |
P_STUB_PIPELINE |
BreedingSource |
stubPipeline |
NUM_SOURCES, P_REPRODUCE
DYNAMIC_SOURCES, likelihood, mybase, P_LIKELIHOOD, P_NUMSOURCES, P_SOURCE, sources, V_SAME, V_STUB
NO_PROBABILITY, P_PROB, probability
Constructor and Description |
---|
StubPipeline() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates a new individual cloned from a prototype,
and suitable to begin use in its own evolutionary
context.
|
Parameter |
defaultBase()
Returns the default base for this prototype.
|
void |
fillStubs(EvolutionState state,
BreedingSource source) |
void |
setup(EvolutionState state,
Parameter base)
Sets up the BreedingPipeline.
|
numSources, produce
finishProducing, individualReplaced, maxChildProduction, minChildProduction, preparePipeline, prepareToProduce, produces, sourcesAreProperForm, typicalIndsProduced
getProbability, pickRandom, setProbability, setupProbabilities
public static final java.lang.String P_STUB
public static final java.lang.String P_STUB_PIPELINE
public BreedingSource stubPipeline
public Parameter defaultBase()
Prototype
defaultBase
in interface Prototype
defaultBase
in class ReproductionPipeline
public void setup(EvolutionState state, Parameter base)
BreedingSource
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}.
setup
in interface Prototype
setup
in interface Setup
setup
in class ReproductionPipeline
Prototype.setup(EvolutionState,Parameter)
public java.lang.Object clone()
Prototype
Typically this should be a full "deep" clone. However, you may share certain elements with other objects rather than clone hem, depending on the situation:
Implementations.
public Object clone()
{
try
{
return super.clone();
}
catch ((CloneNotSupportedException e)
{ throw new InternalError(); } // never happens
}
public Object clone()
{
try
{
MyObject myobj = (MyObject) (super.clone());
// put your deep-cloning code here...
}
catch ((CloneNotSupportedException e)
{ throw new InternalError(); } // never happens
return myobj;
}
public Object clone()
{
MyObject myobj = (MyObject) (super.clone());
// put your deep-cloning code here...
return myobj;
}
clone
in interface Prototype
clone
in class BreedingPipeline
public void fillStubs(EvolutionState state, BreedingSource source)
fillStubs
in class BreedingPipeline