Package ec.gp.ge
Class GrammarRuleNode
java.lang.Object
ec.gp.ge.GrammarNode
ec.gp.ge.GrammarRuleNode
- All Implemented Interfaces:
Serializable
A GrammarNode representing a Rule in the GE Grammar. The head of the GrammarRuleNode
is the name of the rule; and the children are the various choices. These are returned
by getChoice(...) and getNumChoices(). The merge(...) method unifies this GrammarRuleNode
with the choices of another node.
- See Also:
-
Field Summary
Fields inherited from class ec.gp.ge.GrammarNode
children -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChoice(GrammarNode choice) Adds a choice to the children of this node.getChoice(int index) Returns a given choice.intReturns the current number of choices to the node.voidmerge(GrammarRuleNode other) Adds to this node all the choices of another node.toString()A better toString() function -- khaledMethods inherited from class ec.gp.ge.GrammarNode
equals, getHead, hashCode
-
Constructor Details
-
GrammarRuleNode
-
-
Method Details
-
addChoice
Adds a choice to the children of this node. -
getNumChoices
public int getNumChoices()Returns the current number of choices to the node. -
getChoice
Returns a given choice. -
merge
Adds to this node all the choices of another node. -
toString
A better toString() function -- khaled- Specified by:
toStringin classGrammarNode
-