|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectec.Species
ec.vector.VectorSpecies
ec.vector.FloatVectorSpecies
public class FloatVectorSpecies
FloatVectorSpecies is a subclass of VectorSpecies with special constraints for floating-point vectors, namely FloatVectorIndividual and DoubleVectorIndividual.
FloatVectorSpecies can specify min/max numeric constraints on gene values in three different ways.
base.min-gene
base.max-gene
Note: you must provide these values even if you don't use them, as they're used as defaults by #2 and #3 below.
base.num-segments The segments may be defined by either start or end indices of genes. This is controlled by specifying the value of:
base.segment-type which can assume the value of start or end, with start being the default. The indices are defined using Java array style, i.e. the first gene has the index of 0, and the last gene has the index of genome-size - 1.
Using this method, each segment is specified byj...
base.segment.j.start
base.segment.j.min-gene
base.segment.j.max-gene
if segment-type value was chosen as start or by:
base.segment.j.end
base.segment.j.min-gene
base.segment.j.max-gene
if segment-type value is equal to end.
base.min-gene.i
basn.max-gene.i
Any settings for #3 override #2, and both override #1.
FloatVectorSpecies provides support for three ways of mutating a gene:
Parameters
base.min-gene double (default=0.0) |
(the minimum gene value) | |
base.max-gene double >= base.min-gene |
(the maximum gene value) | |
base.min-gene.i double (default=base.min-gene) |
(the minimum gene value for gene i) | |
base.max-gene.i double >= base.min-gene.i (default=base.max-gene) |
(the maximum gene value for gene i) | |
base..num-segments int >= 1 (default=no segments used) |
(the number of gene segments defined) | |
base..segment-type start (default) or end |
(defines the way in which segments are defined: either by providing start indices (segment-type=start) or by providing end indices (segment-type=end) | |
base..segment.j.start 0 <= int < genome length |
(the start index of gene segment j -- the end of a segment is before the start of the next segment) | (used when the value of segment-type parameter is equal to start) |
base..segment.j.end 0 <= int < genome length |
(the end of gene segment j -- the start of a segment is after the end of the previous segment) | (used when the value of segment-type parameter is equal to end) |
base..segment.j.min-gene double (default=0.0) |
(the minimum gene value for segment j) | |
base..segment.j.max-gene double >= base..segment.j.min-gene |
(the maximum gene value for segment j) | |
base.mutation-type reset, gauss, or polynomial (default=reset) |
(the mutation type) | |
base.mutation-stdev double ≥ 0 |
(the standard deviation or the gauss perturbation) | |
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") | |
base.distribution-index int ≥ 0 |
(the mutation distribution index for the polynomial mutation distribution) | |
base.alternative-polynomial-version boolean (default=true) |
(whether to use the "bounded" variation of the polynomial mutation or the standard ("unbounded") version) | |
base.mutation-bounded 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)) |
Field Summary | |
---|---|
static int |
C_GAUSS_MUTATION
|
static int |
C_POLYNOMIAL_MUTATION
|
static int |
C_RESET_MUTATION
|
double |
gaussMutationStdev
|
double[] |
maxGenes
|
double[] |
minGenes
|
int |
mutationDistributionIndex
|
boolean |
mutationIsBounded
|
int |
mutationType
What kind of mutation do we have? |
int |
outOfBoundsRetries
|
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_NUM_SEGMENTS
|
static java.lang.String |
P_OUTOFBOUNDS_RETRIES
|
static java.lang.String |
P_POLYNOMIAL_ALTERNATIVE
|
static java.lang.String |
P_SEGMENT
|
static java.lang.String |
P_SEGMENT_END
|
static java.lang.String |
P_SEGMENT_START
|
static java.lang.String |
P_SEGMENT_TYPE
|
static java.lang.String |
P_STDEV
|
boolean |
polynomialIsAlternative
|
static java.lang.String |
V_GAUSS_MUTATION
|
static java.lang.String |
V_POLYNOMIAL_MUTATION
|
static java.lang.String |
V_RESET_MUTATION
|
Fields inherited from class ec.Species |
---|
f_prototype, i_prototype, P_FITNESS, P_INDIVIDUAL, P_PIPE, pipe_prototype |
Constructor Summary | |
---|---|
FloatVectorSpecies()
|
Method Summary | |
---|---|
boolean |
inNumericalTypeRange(double geneVal)
|
double |
maxGene(int gene)
|
double |
minGene(int gene)
|
void |
outOfRangeRetryLimitReached(EvolutionState state)
|
void |
setup(EvolutionState state,
Parameter base)
The default version of setup(...) loads requested pipelines and calls setup(...) on them and normalizes their probabilities. |
Methods inherited from class ec.vector.VectorSpecies |
---|
defaultBase, newIndividual, warnAboutGene |
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_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 P_OUTOFBOUNDS_RETRIES
public static final java.lang.String P_NUM_SEGMENTS
public static final java.lang.String P_SEGMENT_TYPE
public static final java.lang.String P_SEGMENT_START
public static final java.lang.String P_SEGMENT_END
public static final java.lang.String P_SEGMENT
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 double[] minGenes
public double[] maxGenes
public int mutationType
public double gaussMutationStdev
public boolean mutationIsBounded
public int outOfBoundsRetries
public int mutationDistributionIndex
public boolean polynomialIsAlternative
Constructor Detail |
---|
public FloatVectorSpecies()
Method Detail |
---|
public void outOfRangeRetryLimitReached(EvolutionState state)
public double maxGene(int gene)
public double minGene(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)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |