|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectec.Species
ec.vector.VectorSpecies
public class VectorSpecies
VectorSpecies is a species which can create VectorIndividuals. Different VectorSpecies are used for different kinds of VectorIndividuals: a plain VectorSpecies is probably only applicable for BitVectorIndividuals.
VectorSpecies supports the following recombination methods:
Note that for LongVectorIndividuals, there are certain values that will never be created by line and intermediate recombination, because the recombination is calculated using doubles and then rounded to the nearest long. For large enough values (but still smaller than the maximum long), the difference between one double and the next is greater than one.
VectorSpecies has three wasy to determine the initial size of the individual:
If the algorithm used is the geometric distribution, the VectorSpecies starts at a minimum size and continues flipping a coin with a certain "resize probability", increasing the size each time, until the coin comes up tails (fails). The chunk size must be 1 in this case.
If the algorithm used is the uniform distribution, the VectorSpecies picks a random size between a provided minimum and maximum size, inclusive. The chunk size must be 1 in this case.
If the size is fixed, then you can also provide a "chunk size" which constrains the locations in which crossover can be performed (only along chunk boundaries). The genome size must be a multiple of the chunk size in this case.
VectorSpecies also contains a number of parameters guiding how the individual crosses over and mutates.
Parameters
base.genome-size int >= 1 or one of: geometric, uniform |
(size of the genome, or if 'geometric' or 'uniform', the algorithm used to size the initial genome) |
base.chunk-size 1 <= int <= genome-size (default=1) |
(the chunk size for crossover (crossover will only occur on chunk boundaries)) |
base.geometric-prob 0.0 <= float < 1.0 |
(the coin-flip probability for increasing the initial size using the geometric distribution) |
base.min-initial-size int >= 0 |
(the minimum initial size of the genome) |
base.max-initial-size int >= min-initial-size |
(the maximum initial size of the genome) |
base.crossover-type string, one of: one, two, any |
(default crossover type (one-point, two-point, any-point (uniform), line, or intermediate) |
base.crossover-prob 0.0 >= float >= 1.0 |
(probability that a gene will get crossed over during any-point crossover) |
base.mutation-prob 0.0 <= float <= 1.0 |
(probability that a gene will get mutated over default mutation) |
base.line-extension float >= 0.0 |
(for line and intermediate recombination, how far along the line or outside of the hypercube children can be. If this value is zero, all children must be within the hypercube.) |
Default Base
vector.species
Field Summary | |
---|---|
static int |
C_ANY_POINT
|
static int |
C_GEOMETRIC
|
static int |
C_INTERMED_RECOMB
|
static int |
C_LINE_RECOMB
|
static int |
C_NONE
|
static int |
C_ONE_POINT
|
static int |
C_SIMULATED_BINARY
|
static int |
C_TWO_POINT
|
static int |
C_UNIFORM
|
int |
chunksize
How big of chunks should we define for crossover? |
int |
crossoverDistributionIndex
What should the SBX distribution index be? |
float |
crossoverProbability
Probability that a gene will cross over -- ONLY used in V_ANY_POINT crossover |
int |
crossoverType
What kind of crossover do we have? |
boolean |
dynamicInitialSize
Was the initial size determined dynamically? |
float |
genomeIncreaseProbability
With what probability would our genome be at least 1 larger than it is now during initialization? |
int |
genomeResizeAlgorithm
How should we reset the genome? |
int |
genomeSize
How big of a genome should we create on initialization? |
double |
lineDistance
How far along the long a child can be located for line or intermediate recombination |
int |
maxInitialSize
What's the largest legal genome? |
int |
minInitialSize
What's the smallest legal genome? |
float |
mutationProbability
Probability that a gene will mutate |
static java.lang.String |
P_CHUNKSIZE
|
static java.lang.String |
P_CROSSOVER_DISTRIBUTION_INDEX
|
static java.lang.String |
P_CROSSOVERPROB
|
static java.lang.String |
P_CROSSOVERTYPE
|
static java.lang.String |
P_GENOMESIZE
|
static java.lang.String |
P_GEOMETRIC_PROBABILITY
|
static java.lang.String |
P_LINEDISTANCE
|
static java.lang.String |
P_MUTATIONPROB
|
static java.lang.String |
P_UNIFORM_MAX
|
static java.lang.String |
P_UNIFORM_MIN
|
static java.lang.String |
P_VECTORSPECIES
|
static java.lang.String |
V_ANY_POINT
|
static java.lang.String |
V_GEOMETRIC
|
static java.lang.String |
V_INTERMED_RECOMB
|
static java.lang.String |
V_LINE_RECOMB
|
static java.lang.String |
V_ONE_POINT
|
static java.lang.String |
V_SIMULATED_BINARY
|
static java.lang.String |
V_TWO_POINT
|
static java.lang.String |
V_UNIFORM
|
protected boolean |
warned
|
Fields inherited from class ec.Species |
---|
f_prototype, i_prototype, P_FITNESS, P_INDIVIDUAL, P_PIPE, pipe_prototype |
Constructor Summary | |
---|---|
VectorSpecies()
|
Method Summary | |
---|---|
Parameter |
defaultBase()
Returns the default base for this prototype. |
Individual |
newIndividual(EvolutionState state,
int thread)
Provides a brand-new individual to fill in a population. |
void |
setup(EvolutionState state,
Parameter base)
The default version of setup(...) loads requested pipelines and calls setup(...) on them and normalizes their probabilities. |
protected void |
warnAboutGene(int gene)
|
Methods inherited from class ec.Species |
---|
clone, newIndividual, newIndividual |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String P_VECTORSPECIES
public static final java.lang.String P_CROSSOVERTYPE
public static final java.lang.String P_CHUNKSIZE
public static final java.lang.String V_ONE_POINT
public static final java.lang.String V_TWO_POINT
public static final java.lang.String V_ANY_POINT
public static final java.lang.String V_LINE_RECOMB
public static final java.lang.String V_INTERMED_RECOMB
public static final java.lang.String V_SIMULATED_BINARY
public static final java.lang.String P_CROSSOVER_DISTRIBUTION_INDEX
public static final java.lang.String P_MUTATIONPROB
public static final java.lang.String P_CROSSOVERPROB
public static final java.lang.String P_GENOMESIZE
public static final java.lang.String P_LINEDISTANCE
public static final java.lang.String V_GEOMETRIC
public static final java.lang.String P_GEOMETRIC_PROBABILITY
public static final java.lang.String V_UNIFORM
public static final java.lang.String P_UNIFORM_MIN
public static final java.lang.String P_UNIFORM_MAX
public static final int C_ONE_POINT
public static final int C_TWO_POINT
public static final int C_ANY_POINT
public static final int C_LINE_RECOMB
public static final int C_INTERMED_RECOMB
public static final int C_SIMULATED_BINARY
public static final int C_NONE
public static final int C_GEOMETRIC
public static final int C_UNIFORM
public float mutationProbability
public float crossoverProbability
public int crossoverType
public int genomeSize
public int crossoverDistributionIndex
public int genomeResizeAlgorithm
public int minInitialSize
public int maxInitialSize
public float genomeIncreaseProbability
public int chunksize
public double lineDistance
public boolean dynamicInitialSize
protected boolean warned
Constructor Detail |
---|
public VectorSpecies()
Method Detail |
---|
protected void warnAboutGene(int gene)
public Parameter defaultBase()
Prototype
public void setup(EvolutionState state, Parameter base)
Species
setup
in interface Prototype
setup
in interface Setup
setup
in class Species
Prototype.setup(EvolutionState,Parameter)
public Individual newIndividual(EvolutionState state, int thread)
Species
newIndividual
in class Species
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |