ec.gp
Class GPInitializer

java.lang.Object
  extended by ec.Initializer
      extended by ec.simple.SimpleInitializer
          extended by ec.gp.GPInitializer
All Implemented Interfaces:
Setup, Singleton, java.io.Serializable

public class GPInitializer
extends SimpleInitializer

GPInitializer is a SimpleInitializer which sets up all the Cliques, ( the initial [tree/node]constraints, types, and function sets) for the GP system.

Note that the Cliques must be set up in a very particular order:

  1. GPType
  2. GPNodeConstraints
  3. GPFunctionSets
  4. GPTreeConstraints

Parameter bases

gp.type GPTypes
gp.nc GPNodeConstraints
gp.tc GPTreeConstraints
gp.fs GPFunctionSets

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

Field Summary
 java.util.Hashtable functionSetRepository
           
 java.util.Hashtable nodeConstraintRepository
           
 GPNodeConstraints[] nodeConstraints
           
 int numAtomicTypes
           
 byte numNodeConstraints
           
 int numSetTypes
           
 byte numTreeConstraints
           
static java.lang.String P_ATOMIC
           
static java.lang.String P_FUNCTIONSETS
           
static java.lang.String P_NODECONSTRAINTS
           
static java.lang.String P_SET
           
static java.lang.String P_SIZE
           
static java.lang.String P_TREECONSTRAINTS
           
static java.lang.String P_TYPE
           
static int SIZE_OF_BYTE
           
 java.util.Hashtable treeConstraintRepository
           
 GPTreeConstraints[] treeConstraints
           
 java.util.Hashtable typeRepository
          TODO Comment these members.
 GPType[] types
           
 
Fields inherited from class ec.Initializer
P_POP
 
Constructor Summary
GPInitializer()
           
 
Method Summary
 void postProcessTypes()
          Assigns unique integers to each atomic type, and sets up compatibility arrays for set types.
 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.
 void setupFunctionSets(EvolutionState state, Parameter base)
           
 void setupNodeConstraints(EvolutionState state, Parameter base)
          Sets up all the GPNodeConstraints, loading them from the parameter file.
 void setupTreeConstraints(EvolutionState state, Parameter base)
          Sets up all the GPTreeConstraints, loading them from the parameter file.
 void setupTypes(EvolutionState state, Parameter base)
          Sets up all the types, loading them from the parameter file.
 
Methods inherited from class ec.simple.SimpleInitializer
initialPopulation, setupPopulation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIZE_OF_BYTE

public static final int SIZE_OF_BYTE
See Also:
Constant Field Values

P_TYPE

public static final java.lang.String P_TYPE
See Also:
Constant Field Values

P_NODECONSTRAINTS

public static final java.lang.String P_NODECONSTRAINTS
See Also:
Constant Field Values

P_TREECONSTRAINTS

public static final java.lang.String P_TREECONSTRAINTS
See Also:
Constant Field Values

P_FUNCTIONSETS

public static final java.lang.String P_FUNCTIONSETS
See Also:
Constant Field Values

P_SIZE

public static final java.lang.String P_SIZE
See Also:
Constant Field Values

P_ATOMIC

public static final java.lang.String P_ATOMIC
See Also:
Constant Field Values

P_SET

public static final java.lang.String P_SET
See Also:
Constant Field Values

typeRepository

public java.util.Hashtable typeRepository
TODO Comment these members. TODO Make clients of these members more efficient by reducing unnecessary casting.


types

public GPType[] types

numAtomicTypes

public int numAtomicTypes

numSetTypes

public int numSetTypes

nodeConstraintRepository

public java.util.Hashtable nodeConstraintRepository

nodeConstraints

public GPNodeConstraints[] nodeConstraints

numNodeConstraints

public byte numNodeConstraints

functionSetRepository

public java.util.Hashtable functionSetRepository

treeConstraintRepository

public java.util.Hashtable treeConstraintRepository

treeConstraints

public GPTreeConstraints[] treeConstraints

numTreeConstraints

public byte numTreeConstraints
Constructor Detail

GPInitializer

public GPInitializer()
Method Detail

setup

public void setup(EvolutionState state,
                  Parameter base)
Description copied from interface: Setup
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.

Specified by:
setup in interface Setup
Overrides:
setup in class SimpleInitializer

setupTypes

public void setupTypes(EvolutionState state,
                       Parameter base)
Sets up all the types, loading them from the parameter file. This must be called before anything is called which refers to a type by name.


postProcessTypes

public void postProcessTypes()
Assigns unique integers to each atomic type, and sets up compatibility arrays for set types. If you add new types (heaven forbid), you should call this method again to get all the types set up properly. However, you will have to set up the function sets again as well, as their arrays are based on these type numbers.


setupNodeConstraints

public void setupNodeConstraints(EvolutionState state,
                                 Parameter base)
Sets up all the GPNodeConstraints, loading them from the parameter file. This must be called before anything is called which refers to a type by name.


setupFunctionSets

public void setupFunctionSets(EvolutionState state,
                              Parameter base)

setupTreeConstraints

public void setupTreeConstraints(EvolutionState state,
                                 Parameter base)
Sets up all the GPTreeConstraints, loading them from the parameter file. This must be called before anything is called which refers to a type by name.