public class FloatVectorSpecies extends VectorSpecies
FloatVectorSpecies can specify a number of parameters globally, per-segment, and per-gene. See VectorSpecies for information on how to this works.
FloatVectorSpecies defines a minimum and maximum gene value. These values are used during initialization and, depending on whether mutation-bounded is true, also during various mutation algorithms to guarantee that the gene value will not exceed these minimum and maximum bounds.
FloatVectorSpecies provides support for five ways of mutating a gene.
FloatVectorSpecies provides support for two ways of initializing a gene. The initialization procedure is determined by the choice of mutation procedure as described above. If the mutation is floating-point (reset, gauss, polynomial), then initialization will be done by resetting the gene to uniformly chosen floating-point value between the minimum and maximum legal gene values, inclusive. If the mutation is integer (integer-reset, integer-random-walk), then initialization will be done by performing the same kind of reset, but restricting values to integers only.
Parameters
base.min-gene or | ||
base.segment.segment-number.min-gene or | ||
base.min-gene.gene-number 0.0 <= double <= 1.0 |
(probability that a gene will get mutated over default mutation) | (the minimum gene value) |
base.max-gene or | ||
base.segment.segment-number.max-gene or | ||
base.max-gene.gene-number 0.0 <= double <= 1.0 |
(probability that a gene will get mutated over default mutation) | (the maximum gene value) |
base.mutation-type or | ||
base.segment.segment-number.mutation-type or | ||
base.mutation-prob.gene-number reset, gauss, polynomial, integer-reset, or integer-random-walk (default=reset) |
(the mutation type) | |
base.mutation-stdev or | ||
base.segment.segment-number.mutation-stdev or | ||
base.mutation-stdev.gene-number double ≥ 0 |
(the standard deviation or the gauss perturbation) | |
base.distribution-index or | ||
base.segment.segment-number.distribution-index or | ||
base.distribution-index.gene-number int ≥ 0 |
(the mutation distribution index for the polynomial mutation distribution) | |
base.alternative-polynomial-version or | ||
base.segment.segment-number.alternative-polynomial-version or | ||
base.alternative-polynomial-version.gene-number boolean (default=true) |
(whether to use the "bounded" variation of the polynomial mutation or the standard ("unbounded") version) | |
base.random-walk-probability or | ||
base.segment.segment-number.random-walk-probability or | ||
base.random-walk-probability.gene-number 0.0 <= double <= 1.0 |
(the probability that a random walk will continue. Random walks go up or down by 1.0 until the coin flip comes up false.) | |
base.mutation-bounded or | ||
base.segment.segment-number.mutation-bounded or | ||
base.mutation-bounded.gene-number boolean (default=true) |
(whether mutation is restricted to only being within the min/max gene values. Does not apply to SimulatedBinaryCrossover (which is always bounded)) | |
base.out-of-bounds-retries int ≥ 0 (default=100) |
(number of times the gaussian mutation got the gene out of range before we give up and reset the gene's value; 0 means "never give up") |
Modifier and Type | Field and Description |
---|---|
static int |
C_GAUSS_MUTATION |
static int |
C_INTEGER_RANDOM_WALK_MUTATION |
static int |
C_INTEGER_RESET_MUTATION |
static int |
C_POLYNOMIAL_MUTATION |
static int |
C_RESET_MUTATION |
static int |
DEFAULT_OUT_OF_BOUNDS_RETRIES |
protected double[] |
gaussMutationStdev
Standard deviation for Gaussian Mutation, per gene.
|
protected double[] |
maxGene
Max-gene value, per gene.
|
protected double[] |
minGene
Min-gene value, per gene.
|
protected int[] |
mutationDistributionIndex
The distribution index for Polynomial Mutation, per gene.
|
protected boolean[] |
mutationIsBounded
Whether mutation is bounded to the min- and max-gene values, per gene.
|
protected int[] |
mutationType
Mutation type, per gene.
|
int |
outOfBoundsRetries
The number of times Polynomial Mutation or Gaussian Mutation retry for valid
numbers until they get one.
|
static java.lang.String |
P_MAXGENE |
static java.lang.String |
P_MINGENE |
static java.lang.String |
P_MUTATION_BOUNDED |
static java.lang.String |
P_MUTATION_DISTRIBUTION_INDEX |
static java.lang.String |
P_MUTATIONTYPE |
static java.lang.String |
P_OUTOFBOUNDS_RETRIES |
static java.lang.String |
P_POLYNOMIAL_ALTERNATIVE |
static java.lang.String |
P_RANDOM_WALK_PROBABILITY |
static java.lang.String |
P_STDEV |
protected boolean[] |
polynomialIsAlternative
Whether the Polynomial Mutation method is the "alternative" method, per gene.
|
protected double[] |
randomWalkProbability
The continuation probability for Integer Random Walk Mutation, per gene.
|
static java.lang.String |
V_GAUSS_MUTATION |
static java.lang.String |
V_INTEGER_RANDOM_WALK_MUTATION |
static java.lang.String |
V_INTEGER_RESET_MUTATION |
static java.lang.String |
V_POLYNOMIAL_MUTATION |
static java.lang.String |
V_RESET_MUTATION |
C_ANY_POINT, C_GEOMETRIC, C_INTERMED_RECOMB, C_LINE_RECOMB, C_NONE, C_ONE_POINT, C_ONE_POINT_NO_NOP, C_SIMULATED_BINARY, C_TWO_POINT, C_TWO_POINT_NO_NOP, C_UNIFORM, chunksize, crossoverDistributionIndex, crossoverProbability, crossoverType, duplicateRetries, dynamicInitialSize, genomeIncreaseProbability, genomeResizeAlgorithm, genomeSize, lineDistance, maxInitialSize, minInitialSize, mutationProbability, P_CHUNKSIZE, P_CROSSOVER_DISTRIBUTION_INDEX, P_CROSSOVERPROB, P_CROSSOVERTYPE, P_DUPLICATE_RETRIES, P_GENOMESIZE, P_GEOMETRIC_PROBABILITY, P_LINEDISTANCE, P_MUTATIONPROB, P_NUM_SEGMENTS, P_SEGMENT, P_SEGMENT_END, P_SEGMENT_START, P_SEGMENT_TYPE, P_UNIFORM_MAX, P_UNIFORM_MIN, P_VECTORSPECIES, V_ANY_POINT, V_GEOMETRIC, V_INTERMED_RECOMB, V_LINE_RECOMB, V_ONE_POINT, V_ONE_POINT_NO_NOP, V_SIMULATED_BINARY, V_TWO_POINT, V_TWO_POINT_NO_NOP, V_UNIFORM
f_prototype, i_prototype, P_FITNESS, P_INDIVIDUAL, P_PIPE, pipe_prototype
Constructor and Description |
---|
FloatVectorSpecies() |
Modifier and Type | Method and Description |
---|---|
double |
gaussMutationStdev(int gene) |
boolean |
inNumericalTypeRange(double geneVal) |
protected void |
loadParametersForGene(EvolutionState state,
int index,
Parameter base,
Parameter def,
java.lang.String postfix)
Called when VectorSpecies is setting up per-gene and per-segment parameters.
|
double |
maxGene(int gene) |
double |
minGene(int gene) |
int |
mutationDistributionIndex(int gene) |
boolean |
mutationIsBounded(int gene) |
int |
mutationType(int gene) |
void |
outOfRangeRetryLimitReached(EvolutionState state) |
boolean |
polynomialIsAlternative(int gene) |
double |
randomWalkProbability(int gene) |
void |
setup(EvolutionState state,
Parameter base)
The default version of setup(...) loads requested pipelines and calls setup(...) on them and normalizes their probabilities.
|
contains, contains, contains, contains, defaultBase, duplicateRetries, fill, fill, fill, fill, initializeGenomeSegmentsByEndIndices, initializeGenomeSegmentsByStartIndices, mutationProbability, newIndividual, setupGenome
clone, newIndividual, newIndividual
public static final java.lang.String P_MINGENE
public static final java.lang.String P_MAXGENE
public static final java.lang.String P_MUTATIONTYPE
public static final java.lang.String P_STDEV
public static final java.lang.String P_MUTATION_DISTRIBUTION_INDEX
public static final java.lang.String P_POLYNOMIAL_ALTERNATIVE
public static final java.lang.String V_RESET_MUTATION
public static final java.lang.String V_GAUSS_MUTATION
public static final java.lang.String V_POLYNOMIAL_MUTATION
public static final java.lang.String V_INTEGER_RANDOM_WALK_MUTATION
public static final java.lang.String V_INTEGER_RESET_MUTATION
public static final java.lang.String P_RANDOM_WALK_PROBABILITY
public static final java.lang.String P_OUTOFBOUNDS_RETRIES
public static final java.lang.String P_MUTATION_BOUNDED
public static final int C_RESET_MUTATION
public static final int C_GAUSS_MUTATION
public static final int C_POLYNOMIAL_MUTATION
public static final int C_INTEGER_RESET_MUTATION
public static final int C_INTEGER_RANDOM_WALK_MUTATION
protected double[] minGene
protected double[] maxGene
protected int[] mutationType
protected double[] gaussMutationStdev
protected boolean[] mutationIsBounded
protected int[] mutationDistributionIndex
protected boolean[] polynomialIsAlternative
protected double[] randomWalkProbability
public int outOfBoundsRetries
public static final int DEFAULT_OUT_OF_BOUNDS_RETRIES
public void outOfRangeRetryLimitReached(EvolutionState state)
public double maxGene(int gene)
public double minGene(int gene)
public int mutationType(int gene)
public double gaussMutationStdev(int gene)
public boolean mutationIsBounded(int gene)
public int mutationDistributionIndex(int gene)
public boolean polynomialIsAlternative(int gene)
public double randomWalkProbability(int gene)
public boolean inNumericalTypeRange(double geneVal)
public void setup(EvolutionState state, Parameter base)
Species
setup
in interface Prototype
setup
in interface Setup
setup
in class VectorSpecies
Prototype.setup(EvolutionState,Parameter)
protected void loadParametersForGene(EvolutionState state, int index, Parameter base, Parameter def, java.lang.String postfix)
VectorSpecies
If you override this method, be sure to call super(...) at some point, ideally first.
loadParametersForGene
in class VectorSpecies