ec.vector
Class FloatVectorSpecies
java.lang.Object
|
+--ec.Species
|
+--ec.vector.VectorSpecies
|
+--ec.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.n.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.
- See Also:
- Serialized Form
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
P_MINGENE
public static final java.lang.String P_MINGENE
P_MAXGENE
public static final java.lang.String P_MAXGENE
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
FloatVectorSpecies
public FloatVectorSpecies()
individualGeneMinMaxUsed
public final boolean individualGeneMinMaxUsed()
maxGene
public final double maxGene(int gene)
minGene
public final double minGene(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.
- Overrides:
setup
in class VectorSpecies
- Following copied from class:
ec.Species
- See Also:
Prototype.setup(EvolutionState,Parameter)