Package ec.gp.ge
Class GrammarFunctionNode
java.lang.Object
ec.gp.ge.GrammarNode
ec.gp.ge.GrammarFunctionNode
- All Implemented Interfaces:
Serializable
A GrammarNode representing a GPNode in the GE Grammar. The head of the GrammarFunctionNode
is the name of the GPNode in the grammar; and the children are various arguments to the node
as defined by the grammar. These are returned by getArgument(...) and getNumArguments().
The GrammarFunctionNode holds a prototypical GPNode from which clones can be made.
- See Also:
-
Field Summary
Fields inherited from class ec.gp.ge.GrammarNode
children -
Constructor Summary
ConstructorsConstructorDescriptionGrammarFunctionNode(GPFunctionSet gpfs, String name) Determines the GPNode from the function set by the name.GrammarFunctionNode(String name) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArgument(GrammarNode arg) Adds a given argument to the node.getArgument(int index) Returna given argument.Returns the prototype without cloning it first.intReturns the number of arguments.toString()A better toString() function -- khaledMethods inherited from class ec.gp.ge.GrammarNode
equals, getHead, hashCode
-
Constructor Details
-
GrammarFunctionNode
Determines the GPNode from the function set by the name. If there is more than one such node (which shouldn't be the case) then only the first such node is used. Stores the prototype. -
GrammarFunctionNode
-
-
Method Details
-
addArgument
Adds a given argument to the node. -
getNumArguments
public int getNumArguments()Returns the number of arguments. -
getArgument
Returna given argument. -
getGPNodePrototype
Returns the prototype without cloning it first. Be certain to clone before using. -
toString
A better toString() function -- khaled- Specified by:
toStringin classGrammarNode
-