ec.gp
Class GPSpecies

java.lang.Object
  extended by ec.Species
      extended by ec.gp.GPSpecies
All Implemented Interfaces:
Prototype, Setup, java.io.Serializable, java.lang.Cloneable

public class GPSpecies
extends Species

GPSpecies is a simple individual which is suitable as a species for GP subpopulations. GPSpecies' individuals must be GPIndividuals, and often their pipelines are GPBreedingPipelines (at any rate, the pipelines will have to return members of GPSpecies!).

Default Base
gp.species

Version:
1.0
Author:
Sean Luke
See Also:
Serialized Form

Field Summary
static java.lang.String P_GPSPECIES
           
 
Fields inherited from class ec.Species
f_prototype, i_prototype, P_FITNESS, P_INDIVIDUAL, P_PIPE, pipe_prototype
 
Constructor Summary
GPSpecies()
           
 
Method Summary
 Parameter defaultBase()
          Returns the default base for this prototype.
 Individual newIndividual(EvolutionState state, java.io.DataInput dataInput)
          Provides an individual read from a DataInput source, including the fitness.
 Individual newIndividual(EvolutionState state, int thread)
          Provides a brand-new individual to fill in a population.
 Individual newIndividual(EvolutionState state, java.io.LineNumberReader reader)
          Provides an individual read from a stream, including the fitness; 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
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

P_GPSPECIES

public static final java.lang.String P_GPSPECIES
See Also:
Constant Field Values
Constructor Detail

GPSpecies

public GPSpecies()
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.

Specified by:
setup in interface Prototype
Specified by:
setup in interface Setup
Overrides:
setup in class Species
See Also:
Prototype.setup(EvolutionState,Parameter)

newIndividual

public Individual newIndividual(EvolutionState state,
                                int thread)
Description copied from class: Species
Provides a brand-new individual to fill in a population. The default form simply calls clone(), creates a fitness, sets evaluated to false, and sets the species. If you need to make a more custom genotype (as is the case for GPSpecies, which requires a light rather than deep clone), you will need to override this method as you see fit.

Overrides:
newIndividual in class Species

newIndividual

public Individual newIndividual(EvolutionState state,
                                java.io.LineNumberReader reader)
                         throws java.io.IOException
Description copied from class: Species
Provides an individual read from a stream, including the fitness; the individual will appear as it was written by printIndividual(...). Doesn't close the stream. Sets evaluated to false and sets the species. If you need to make a more custom mechanism (as is the case for GPSpecies, which requires a light rather than deep clone), you will need to override this method as you see fit.

Overrides:
newIndividual in class Species
Throws:
java.io.IOException

newIndividual

public Individual newIndividual(EvolutionState state,
                                java.io.DataInput dataInput)
                         throws java.io.IOException
Description copied from class: Species
Provides an individual read from a DataInput source, including the fitness. Doesn't close the DataInput. Sets evaluated to false and sets the species. If you need to make a more custom mechanism (as is the case for GPSpecies, which requires a light rather than deep clone), you will need to override this method as you see fit.

Overrides:
newIndividual in class Species
Throws:
java.io.IOException