ec.gp
Class GPInitializer
- java.lang.Object
-
- ec.Initializer
-
- ec.simple.SimpleInitializer
-
- ec.gp.GPInitializer
-
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:
- GPType
- GPNodeConstraints
- GPFunctionSets
- GPTreeConstraints
Parameter bases
gp.type GPTypes gp.nc GPNodeConstraints gp.tc GPTreeConstraints gp.fs GPFunctionSets - See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description java.util.HashtablefunctionSetRepositoryjava.util.HashtablenodeConstraintRepositoryGPNodeConstraints[]nodeConstraintsintnumAtomicTypesbytenumNodeConstraintsintnumSetTypesbytenumTreeConstraintsstatic java.lang.StringP_ATOMICstatic java.lang.StringP_FUNCTIONSETSstatic java.lang.StringP_NODECONSTRAINTSstatic java.lang.StringP_SETstatic java.lang.StringP_SIZEstatic java.lang.StringP_TREECONSTRAINTSstatic java.lang.StringP_TYPEstatic intSIZE_OF_BYTEjava.util.HashtabletreeConstraintRepositoryGPTreeConstraints[]treeConstraintsjava.util.HashtabletypeRepositoryTODO Comment these members.GPType[]types-
Fields inherited from class ec.Initializer
P_POP
-
-
Constructor Summary
Constructors Constructor and Description GPInitializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidpostProcessTypes()Assigns unique integers to each atomic type, and sets up compatibility arrays for set types.voidsetup(EvolutionState state, Parameter base)Sets up the object by reading it from the parameters stored in state, built off of the parameter base base.voidsetupFunctionSets(EvolutionState state, Parameter base)voidsetupNodeConstraints(EvolutionState state, Parameter base)Sets up all the GPNodeConstraints, loading them from the parameter file.voidsetupTreeConstraints(EvolutionState state, Parameter base)Sets up all the GPTreeConstraints, loading them from the parameter file.voidsetupTypes(EvolutionState state, Parameter base)Sets up all the types, loading them from the parameter file.-
Methods inherited from class ec.simple.SimpleInitializer
initialPopulation, setupPopulation
-
-
-
-
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
-
-
Method Detail
-
setup
public void setup(EvolutionState state, Parameter base)
Description copied from interface:SetupSets 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:
setupin interfaceSetup- Overrides:
setupin classSimpleInitializer
-
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.
-
-
DMelt 3.0 © DataMelt by jWork.ORG