org.encog.ml.prg
Class ProgramNode
- java.lang.Object
-
- org.encog.ml.tree.basic.BasicTreeNode
-
- org.encog.ml.prg.ProgramNode
-
- All Implemented Interfaces:
- java.io.Serializable, TreeNode
public class ProgramNode extends BasicTreeNode implements java.io.Serializable
Represents a program node in an EPL program.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description ProgramNode(EncogProgram theOwner, ProgramExtensionTemplate theTemplate, ProgramNode[] theArgs)Construct the program node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanallConstChildren()booleanallConstDescendants()ExpressionValueevaluate()ProgramNodegetChildNode(int index)Get the specified child node.ExpressionValue[]getData()java.lang.StringgetName()EncogProgramgetOwner()ProgramExtensionTemplategetTemplate()booleanisVariable()java.lang.StringtoString()-
Methods inherited from class org.encog.ml.tree.basic.BasicTreeNode
addChildNodes, allLeafChildren, getChildNodes, isLeaf, size
-
-
-
-
Constructor Detail
-
ProgramNode
public ProgramNode(EncogProgram theOwner, ProgramExtensionTemplate theTemplate, ProgramNode[] theArgs)
Construct the program node.- Parameters:
theOwner- The owner of the node.theTemplate- The opcode that this node is based on.theArgs- The child nodes to this node.
-
-
Method Detail
-
allConstChildren
public boolean allConstChildren()
- Returns:
- True if all children are constant.
-
allConstDescendants
public boolean allConstDescendants()
- Returns:
- True if all descendants are constant.
-
evaluate
public ExpressionValue evaluate()
- Returns:
- The evaluated value of this node.
-
getChildNode
public ProgramNode getChildNode(int index)
Get the specified child node.- Parameters:
index- The index of this node.- Returns:
- The child node requested.
-
getData
public ExpressionValue[] getData()
- Returns:
- The node data.
-
getName
public java.lang.String getName()
- Returns:
- The name of this node (from the opcode template).
-
getOwner
public EncogProgram getOwner()
- Returns:
- The EncogProgram that owns this node.
-
getTemplate
public ProgramExtensionTemplate getTemplate()
- Returns:
- the template
-
isVariable
public boolean isVariable()
- Returns:
- Returns true if this node's value is variable.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG