ec.vector
Class VectorSpecies

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

public class VectorSpecies
extends Species

VectorSpecies is a species which can create VectorIndividuals. Different VectorSpecies are used for different kinds of VectorIndividuals: a plain VectorSpecies is probably only applicable for BitVectorIndividuals.

VectorSpecies contains a number of parameters guiding how the individual crosses over and mutates.

Parameters
base.n.genome-size
int >= 1
(size of the genome)
base.n.chunk-size
1 <= int <= genome-size (default=1)
(the chunk size for crossover (crossover will only occur on chunk boundaries))
base.crossover-type
string, one of: one, two, any
(default crossover type (one-point, two-point, or any-point (uniform) crossover)
base.crossover-prob
0.0 >= float >= 1.0
(probability that a gene will get crossed over during any-point crossover)
base.mutation-prob
0.0 <= float <= 1.0
(probability that a gene will get mutated over default mutation)

Default Base
vector.species

See Also:
Serialized Form

Field Summary
static int C_ANY_POINT
           
static int C_ONE_POINT
           
static int C_TWO_POINT
           
 int chunksize
          How big of chunks should we define for crossover?
 float crossoverProbability
          Probability that a gene will cross over -- ONLY used in V_ANY_POINT crossover
 int crossoverType
          What kind of crossover do we have?
 int genomeSize
          How big of a genome should we create on initialization?
 float mutationProbability
          Probability that a gene will mutate
static java.lang.String P_CHUNKSIZE
           
static java.lang.String P_CROSSOVERPROB
           
static java.lang.String P_CROSSOVERTYPE
           
static java.lang.String P_GENOMESIZE
           
static java.lang.String P_MUTATIONPROB
           
static java.lang.String P_VECTORSPECIES
           
static java.lang.String V_ANY_POINT
           
static java.lang.String V_ONE_POINT
           
static java.lang.String V_TWO_POINT
           
 
Fields inherited from class ec.Species
i_prototype, P_INDIVIDUAL, P_PIPE, pipe_prototype
 
Constructor Summary
VectorSpecies()
           
 
Method Summary
 Parameter defaultBase()
          Returns the default base for this prototype.
 Individual newIndividual(EvolutionState state, Subpopulation _population, Fitness _fitness)
          override this to provide a brand-new individual to fill in a population.
 Individual newIndividual(EvolutionState state, Subpopulation _population, Fitness _fitness, java.io.LineNumberReader reader)
          Override this to provide an individual read from a file; the individual will appear as it was written by printIndividual(...).
 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.Species
protoClone, protoCloneSimple
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

P_VECTORSPECIES

public static final java.lang.String P_VECTORSPECIES

P_CROSSOVERTYPE

public static final java.lang.String P_CROSSOVERTYPE

P_CHUNKSIZE

public static final java.lang.String P_CHUNKSIZE

V_ONE_POINT

public static final java.lang.String V_ONE_POINT

V_TWO_POINT

public static final java.lang.String V_TWO_POINT

V_ANY_POINT

public static final java.lang.String V_ANY_POINT

P_MUTATIONPROB

public static final java.lang.String P_MUTATIONPROB

P_CROSSOVERPROB

public static final java.lang.String P_CROSSOVERPROB

P_GENOMESIZE

public static final java.lang.String P_GENOMESIZE

C_ONE_POINT

public static final int C_ONE_POINT

C_TWO_POINT

public static final int C_TWO_POINT

C_ANY_POINT

public static final int C_ANY_POINT

mutationProbability

public float mutationProbability
Probability that a gene will mutate

crossoverProbability

public float crossoverProbability
Probability that a gene will cross over -- ONLY used in V_ANY_POINT crossover

crossoverType

public int crossoverType
What kind of crossover do we have?

genomeSize

public int genomeSize
How big of a genome should we create on initialization?

chunksize

public int chunksize
How big of chunks should we define for crossover?
Constructor Detail

VectorSpecies

public VectorSpecies()
Method Detail

defaultBase

public Parameter defaultBase()
Description copied from interface: Prototype
Returns the default base for this prototype. This should generally be implemented by building off of the static base() method on the DefaultsForm object for the prototype's package. This should be callable during setup(...).

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 Species
Following copied from class: ec.Species
See Also:
Prototype.setup(EvolutionState,Parameter)

newIndividual

public Individual newIndividual(EvolutionState state,
                                Subpopulation _population,
                                Fitness _fitness)
                         throws java.lang.CloneNotSupportedException
Description copied from class: Species
override this to provide a brand-new individual to fill in a population. The CloneNotSupportedException permits you to use protoClone() rather than protoCloneSimple(), for efficiency gains. It's assumed that the thread is thread 0.
Overrides:
newIndividual in class Species

newIndividual

public Individual newIndividual(EvolutionState state,
                                Subpopulation _population,
                                Fitness _fitness,
                                java.io.LineNumberReader reader)
                         throws java.io.IOException,
                                java.lang.CloneNotSupportedException
Description copied from class: Species
Override this to provide an individual read from a file; the individual will appear as it was written by printIndividual(...). You should read and set up the fitness as well. Don't close the file.
Overrides:
newIndividual in class Species