ec.gp
Class GPData

java.lang.Object
  extended by ec.gp.GPData
All Implemented Interfaces:
Prototype, Setup, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
AntData, EdgeData, LawnmowerData, MultiplexerData, MultiplexerData, ParityData, RegressionData, TwoBoxData

public abstract class GPData
extends java.lang.Object
implements Prototype

GPData is the parent class of data transferred between GPNodes. If performed correctly, there need be only one GPData instance ever created in the evaluation of many individuals.

Default Base
gp.data

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

Field Summary
static java.lang.String P_GPDATA
           
 
Constructor Summary
GPData()
           
 
Method Summary
 java.lang.Object clone()
          Creates a new individual cloned from a prototype, and suitable to begin use in its own evolutionary context.
abstract  GPData copyTo(GPData gpd)
          Modifies gpd so that gpd is equivalent to us.
 Parameter defaultBase()
          Returns the default base for this prototype.
 void setup(EvolutionState state, Parameter base)
          Sets up the object by reading it from the parameters stored in state, built off of the parameter base base.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

P_GPDATA

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

GPData

public GPData()
Method Detail

copyTo

public abstract GPData copyTo(GPData gpd)
Modifies gpd so that gpd is equivalent to us. You may safely assume that gpd is of the same class as we are.


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

Specified by:
defaultBase in interface Prototype

setup

public void setup(EvolutionState state,
                  Parameter base)
Description copied from interface: Prototype
Sets up the object by reading it from the parameters stored in state, built off of the parameter base base. If an ancestor implements this method, be sure to call super.setup(state,base); before you do anything else.

For prototypes, setup(...) is typically called once for the prototype instance; cloned instances do not receive the setup(...) call. setup(...) may be called more than once; the only guarantee is that it will get called at least once on an instance or some "parent" object from which it was ultimately cloned.

Specified by:
setup in interface Prototype
Specified by:
setup in interface Setup

clone

public java.lang.Object clone()
Description copied from interface: Prototype
Creates a new individual cloned from a prototype, and suitable to begin use in its own evolutionary context.

Typically this should be a full "deep" clone. However, you may share certain elements with other objects rather than clone hem, depending on the situation:

Implementations.

Specified by:
clone in interface Prototype
Overrides:
clone in class java.lang.Object