ec.vector
Class FloatVectorSpecies

java.lang.Object
  extended byec.Species
      extended byec.vector.VectorSpecies
          extended byec.vector.FloatVectorSpecies
All Implemented Interfaces:
java.lang.Cloneable, Prototype, java.io.Serializable, Setup

public class FloatVectorSpecies
extends VectorSpecies

FloatVectorSpecies is a subclass of VectorSpecies with special constraints for floating-point vectors, namely FloatVectorIndividual and DoubleVectorIndividual.

FloatVectorSpecies can specify numeric constraints on gene values in one of two ways. First, they can simply specify a default min and max value. Or they can specify an array of min/max pairs, one pair per gene. FloatVectorSpecies will check to see if the second approach is to be used by looking for parameter base.max-gene.0 in the array -- if it exists, FloatvectorSpecies will assume all such parameters exist, and will load up to the genome length. If a parameter is missing, in this range, a warning will be issued during Individual setup. If the array is shorter than the genome, then the default min/max values will be used for the remaining genome values. This means that even if you specify the array, you need to still specify the default min/max values just in case.

FloatVectorSpecies provides support for two 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.mutation-type
reset or gauss (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")

See Also:
Serialized Form

Field Summary
static int C_GAUSS_MUTATION
           
static int C_RESET_MUTATION
           
 double gaussMutationStdev
           
 double[] gaussMutationStdevs
          Set to null if not specified If individualGeneMinMaxUsed, that this is used too.
 double maxGene
           
 double[] maxGenes
          Set to null if not specified
 double minGene
           
 double[] minGenes
          Set to null if not specified
 int mutationType
          What kind of mutation do we have?
 int outOfRangeRetries
           
static java.lang.String P_MAXGENE
           
static java.lang.String P_MINGENE
           
static java.lang.String P_MUTATIONTYPE
           
static java.lang.String P_OUTOFBOUNDS_RETRIES
           
static java.lang.String P_STDEV
           
static java.lang.String V_GAUSS_MUTATION
           
static java.lang.String V_RESET_MUTATION
           
 
Fields inherited from class ec.vector.VectorSpecies
C_ANY_POINT, C_ONE_POINT, C_TWO_POINT, chunksize, crossoverProbability, crossoverType, genomeSize, mutationProbability, P_CHUNKSIZE, P_CROSSOVERPROB, P_CROSSOVERTYPE, P_GENOMESIZE, P_MUTATIONPROB, P_VECTORSPECIES, V_ANY_POINT, V_ONE_POINT, V_TWO_POINT
 
Fields inherited from class ec.Species
i_prototype, P_INDIVIDUAL, P_PIPE, pipe_prototype
 
Constructor Summary
FloatVectorSpecies()
           
 
Method Summary
 double gaussMutationStdev(int gene)
           
 boolean individualGeneMinMaxUsed()
           
 boolean inRange(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
 
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

P_MINGENE

public static final java.lang.String P_MINGENE
See Also:
Constant Field Values

P_MAXGENE

public static final java.lang.String P_MAXGENE
See Also:
Constant Field Values

P_MUTATIONTYPE

public static final java.lang.String P_MUTATIONTYPE
See Also:
Constant Field Values

P_STDEV

public static java.lang.String P_STDEV

V_RESET_MUTATION

public static final java.lang.String V_RESET_MUTATION
See Also:
Constant Field Values

V_GAUSS_MUTATION

public static final java.lang.String V_GAUSS_MUTATION
See Also:
Constant Field Values

C_RESET_MUTATION

public static final int C_RESET_MUTATION
See Also:
Constant Field Values

C_GAUSS_MUTATION

public static final int C_GAUSS_MUTATION
See Also:
Constant Field Values

P_OUTOFBOUNDS_RETRIES

public static final java.lang.String P_OUTOFBOUNDS_RETRIES
See Also:
Constant Field Values

minGene

public double minGene

maxGene

public double maxGene

minGenes

public double[] minGenes
Set to null if not specified


maxGenes

public double[] maxGenes
Set to null if not specified


mutationType

public int mutationType
What kind of mutation do we have?


gaussMutationStdev

public double gaussMutationStdev

gaussMutationStdevs

public double[] gaussMutationStdevs
Set to null if not specified If individualGeneMinMaxUsed, that this is used too.


outOfRangeRetries

public int outOfRangeRetries
Constructor Detail

FloatVectorSpecies

public FloatVectorSpecies()
Method Detail

outOfRangeRetryLimitReached

public void outOfRangeRetryLimitReached(EvolutionState state)

individualGeneMinMaxUsed

public final boolean individualGeneMinMaxUsed()

maxGene

public final double maxGene(int gene)

minGene

public final double minGene(int gene)

gaussMutationStdev

public final double gaussMutationStdev(int gene)

inRange

public boolean inRange(double geneVal)

setup

public void setup(EvolutionState state,
                  Parameter base)
Description copied from class: Species
The default version of setup(...) loads requested pipelines and calls setup(...) on them and normalizes their probabilities. If your individual prototype might need to know special things about the species (like parameters stored in it), then when you override this setup method, you'll need to set those parameters BEFORE you call super.setup(...), because the setup(...) code in Species sets up the prototype.

Specified by:
setup in interface Prototype
Overrides:
setup in class VectorSpecies