ec.gp
Class GPSetType
- java.lang.Object
-
- ec.gp.GPType
-
- ec.gp.GPSetType
-
public final class GPSetType extends GPType
A GPSetType is a GPType which contains GPAtomicTypes in a set, and is used as a generic GP type. For more information, see GPType GPSetTypes implement their set using both a hash table and an array. if the size of the set is "significantly big", then the hash table is used to look up membership in the set (O(1), but with a big constant). If the size is small, then the array is used (O(n)). The dividing line is determined by the constant START_USING_HASH_BEYOND, which you might play with to optimize for your system.- See Also:
GPType, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringP_MEMBERstatic java.lang.StringP_SIZEjava.util.Hashtabletypes_hThe hashtable of types in the setint[]types_packedA packed, sorted array of atomic types in the setboolean[]types_sparseA sparse array of atomic types in the set
-
Constructor Summary
Constructors Constructor and Description GPSetType()You should not construct new types.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancompatibleWith(GPInitializer initializer, GPType t)Am I compatible with ("fit" with) t? For two atomic types, this is done by direct pointer equality.voidpostProcessSetType(int totalAtomicTypes)Sets up the packed and sparse arrays based on the hashtablevoidsetup(EvolutionState state, Parameter base)Sets up the object by reading it from the parameters stored in state, built off of the parameter base base.
-
-
-
Field Detail
-
P_MEMBER
public static final java.lang.String P_MEMBER
- See Also:
- Constant Field Values
-
P_SIZE
public static final java.lang.String P_SIZE
- See Also:
- Constant Field Values
-
types_packed
public int[] types_packed
A packed, sorted array of atomic types in the set
-
types_sparse
public boolean[] types_sparse
A sparse array of atomic types in the set
-
types_h
public java.util.Hashtable types_h
The hashtable of types in the set
-
-
Method Detail
-
postProcessSetType
public void postProcessSetType(int totalAtomicTypes)
Sets up the packed and sparse arrays based on the hashtable
-
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.
-
compatibleWith
public final boolean compatibleWith(GPInitializer initializer, GPType t)
Description copied from class:GPTypeAm I compatible with ("fit" with) t? For two atomic types, this is done by direct pointer equality. For two set types, this is done by determining if the intersection is nonempty. A set type is compatible with an atomic type if it contains the atomic type in its set.- Specified by:
compatibleWithin classGPType
-
-
DMelt 3.0 © DataMelt by jWork.ORG