|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ec.gp.GPFunctionSet
GPFunctionSet is a Clique which represents a set of GPNode prototypes forming a standard function set for forming certain trees in individuals. GPFunctionSets instances have unique names with which they're referenced by GPTreeConstraints objects indicating that they're used for certain trees. GPFunctionSets store their GPNode Prototypes in three hashtables, one for all nodes, one for nonterminals, and one for terminals. Each hashed item is an array of GPFuncInfo objects containing the GPNodes proper, hashed by the return type of the GPNodes in the array. GPFunctionSets also contain prototypical GPFuncInfo nodes which they clone to form their arrays.
Parameters
base.name String |
(name of function set. Must be different from other function set instances) |
base.size int >= 1 |
(number of functions in the function set) |
base.func.n classname, inherits and != ec.gp.GPNode |
(class of function node n in the set) |
base.info classname, inherits or == ec.gp.GPFuncInfo, or nothing |
(class of the prototypical GPFuncInfo object. If nothing, this defaults to ec.gp.GPFuncInfo) |
Parameter bases
base.info | p_funcinfo |
base.func.n | function node n |
Field Summary | |
static java.util.Hashtable |
all
A global storage facility for all known GPFunctionSet objects. |
java.lang.String |
name
Name of the GPFunctionSet |
GPFuncInfo[][] |
nodes
The nodes that our GPTree can use: nodes[type][thenodes]. |
java.util.Hashtable |
nodes_h
The nodes that our GPTree can use: arrays of nodes hashed by type. |
GPFuncInfo[][][] |
nodesByArity
Nodes == a given arity, that is: nodesByArity[type][arity][thenodes] |
GPFuncInfo[][] |
nonterminals
The nonterminals our GPTree can use: nonterminals[type][thenodes]. |
java.util.Hashtable |
nonterminals_h
The nonterminals our GPTree can use: arrays of nonterminals hashed by type. |
GPFuncInfo[][][] |
nonterminalsOverArity
Nonterminals >= a given arity, that is: nonterminalsOverArity[type][arity][thenodes] -- this will be O(n^2). |
GPFuncInfo[][][] |
nonterminalsUnderArity
Nonterminals <= a given arity, that is: nonterminalsUnderArity[type][arity][thenodes] -- this will be O(n^2). |
static java.lang.String |
P_FUNC
|
GPFuncInfo |
p_funcinfo
The prototypical GPFuncInfo node. |
static java.lang.String |
P_FUNCINFO
|
static java.lang.String |
P_NAME
|
static java.lang.String |
P_SIZE
|
GPFuncInfo[][] |
terminals
The terminals our GPTree can use: terminals[type][thenodes]. |
java.util.Hashtable |
terminals_h
The terminals our GPTree can use: arrays of terminals hashed by type. |
Constructor Summary | |
GPFunctionSet()
|
Method Summary | |
static GPFunctionSet |
functionSetFor(java.lang.String functionSetName,
EvolutionState state)
Returns the function set for a given name. |
void |
postProcessFunctionSet()
Sets up the arrays based on the hashtables |
void |
setup(EvolutionState state,
Parameter base)
Must be done after GPType and GPNodeConstraints have been set up |
static void |
setupFunctionSets(EvolutionState state,
Parameter base)
Sets up all the GPFunctionSet, loading them from the parameter file. |
java.lang.String |
toString()
Returns the name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String P_NAME
public static final java.lang.String P_SIZE
public static final java.lang.String P_FUNCINFO
public static final java.lang.String P_FUNC
public java.lang.String name
public java.util.Hashtable nodes_h
public GPFuncInfo[][] nodes
public java.util.Hashtable nonterminals_h
public GPFuncInfo[][] nonterminals
public java.util.Hashtable terminals_h
public GPFuncInfo[][] terminals
public GPFuncInfo[][][] nodesByArity
public GPFuncInfo[][][] nonterminalsUnderArity
public GPFuncInfo[][][] nonterminalsOverArity
public GPFuncInfo p_funcinfo
public static java.util.Hashtable all
Constructor Detail |
public GPFunctionSet()
Method Detail |
public java.lang.String toString()
toString
in class java.lang.Object
public static void setupFunctionSets(EvolutionState state, Parameter base)
public void postProcessFunctionSet()
public void setup(EvolutionState state, Parameter base)
setup
in interface Setup
public static GPFunctionSet functionSetFor(java.lang.String functionSetName, EvolutionState state)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |