/* Copyright 2006 by Sean Luke Licensed under the Academic Free License version 3.0 See the file "LICENSE" for more information */ package ec.breed; import ec.*; import ec.util.*; /* * MultiBreedingPipeline.java * * Created: December 28, 1999 * By: Sean Luke */ /** * MultiBreedingPipeline is a BreedingPipeline stores some n child sources; * each time it must produce an individual or two, * it picks one of these sources at random and has it do the production.
Typical Number of Individuals Produced Per produce(...) call
If by base.generate-max is true, then always the maximum
number of the typical numbers of any child source. If false, then varies
depending on the child source picked.
Number of Sources
Dynamic. As many as the user specifies.
Parameters
base.generate-max bool = true (default) or false |
(Each time produce(...) is called, should the MultiBreedingPipeline force all its sources to produce exactly the same number of individuals as the largest typical number of individuals produced by any source in the group?) |
Default Base
breed.multibreed
*
* @author Sean Luke
* @version 1.0
*/
public class MultiBreedingPipeline extends BreedingPipeline
{
public static final String P_GEN_MAX = "generate-max";
public static final String P_MULTIBREED = "multibreed";
public int maxGeneratable;
public boolean generateMax;
public Parameter defaultBase()
{
return BreedDefaults.base().push(P_MULTIBREED);
}
public int numSources() { return DYNAMIC_SOURCES; }
public void setup(final EvolutionState state, final Parameter base)
{
super.setup(state,base);
Parameter def = defaultBase();
float total = 0.0f;
for(int x=0;x