ec.vector
Class IntegerVectorSpecies

java.lang.Object
  |
  +--ec.Species
        |
        +--ec.vector.VectorSpecies
              |
              +--ec.vector.IntegerVectorSpecies
All Implemented Interfaces:
java.lang.Cloneable, Prototype, java.io.Serializable, Setup

public class IntegerVectorSpecies
extends VectorSpecies

IntegerVectorSpecies is a subclass of VectorSpecies with special constraints for integral vectors, namely ByteVectorIndividual, ShortVectorIndividual, IntegerVectorIndividual, and LongVectorIndividual.

IntegerVectorSpecies 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. IntegerVectorSpecies 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, IntegerVectorSpecies 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

Field Summary
 long maxGene
           
 long[] maxGenes
          Set to null if not specified
 long minGene
           
 long[] minGenes
          Set to null if not specified
static java.lang.String P_MAXGENE
           
static java.lang.String P_MINGENE
           
 
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
IntegerVectorSpecies()
           
 
Method Summary
 boolean individualGeneMinMaxUsed()
           
 boolean inRange(long geneVal)
           
 long maxGene(int gene)
           
 long minGene(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.
 
Methods inherited from class ec.vector.VectorSpecies
defaultBase, newIndividual, newIndividual
 
Methods inherited from class ec.Species
protoClone, protoCloneSimple
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

P_MINGENE

public static final java.lang.String P_MINGENE

P_MAXGENE

public static final java.lang.String P_MAXGENE

minGene

public long minGene

maxGene

public long maxGene

minGenes

public long[] minGenes
Set to null if not specified

maxGenes

public long[] maxGenes
Set to null if not specified
Constructor Detail

IntegerVectorSpecies

public IntegerVectorSpecies()
Method Detail

individualGeneMinMaxUsed

public final boolean individualGeneMinMaxUsed()

maxGene

public final long maxGene(int gene)

minGene

public final long minGene(int gene)

inRange

public boolean inRange(long 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)