org.encog.ml.prg.extension
Interface ProgramExtensionTemplate
-
- All Superinterfaces:
- java.io.Serializable
- All Known Implementing Classes:
- BasicTemplate, ConstantPool
public interface ProgramExtensionTemplate extends java.io.SerializableDefines an opcode. Opcodes are used to extend Encog programs.
-
-
Field Summary
Fields Modifier and Type Field and Description static java.util.List<ParamTemplate>NO_PARAMSNo parameters.static intNO_PRECDefines a very low precidence.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description ExpressionValueevaluate(ProgramNode actual)Evaluate the specified actual program node, using this opcode template.intgetChildNodeCount()intgetDataSize()java.lang.StringgetName()NodeTypegetNodeType()java.util.List<ParamTemplate>getParams()intgetPrecedence()ParamTemplategetReturnValue()booleanisPossibleReturnType(EncogProgramContext context, ValueType rtn)Determines if the specified return type is a possible return type.booleanisVariable()voidrandomize(java.util.Random rnd, java.util.List<ValueType> desiredType, ProgramNode actual, double minValue, double maxValue)Randomize this actual tree node.
-
-
-
Field Detail
-
NO_PREC
static final int NO_PREC
Defines a very low precidence.- See Also:
- Constant Field Values
-
NO_PARAMS
static final java.util.List<ParamTemplate> NO_PARAMS
No parameters.
-
-
Method Detail
-
evaluate
ExpressionValue evaluate(ProgramNode actual)
Evaluate the specified actual program node, using this opcode template.- Parameters:
actual- The tree node in the actual program.- Returns:
- The result of the evaluation.
-
getChildNodeCount
int getChildNodeCount()
- Returns:
- Get the number of child nodes that this opcode requires.
-
getDataSize
int getDataSize()
- Returns:
- The size of extra data that is stored by this node.
-
getName
java.lang.String getName()
- Returns:
- Get the name of this opcode.
-
getNodeType
NodeType getNodeType()
- Returns:
- The node type.
-
getParams
java.util.List<ParamTemplate> getParams()
- Returns:
- The parameters (child nodes) required by this node.
-
getPrecedence
int getPrecedence()
- Returns:
- The operator precedence.
-
getReturnValue
ParamTemplate getReturnValue()
- Returns:
- The return value for this opcode.
-
isPossibleReturnType
boolean isPossibleReturnType(EncogProgramContext context, ValueType rtn)
Determines if the specified return type is a possible return type.- Parameters:
context- The program context.rtn- The potential return type to check.- Returns:
- True, if the specified type is a possible return type.
-
isVariable
boolean isVariable()
- Returns:
- Returns true if this node is variable.
-
randomize
void randomize(java.util.Random rnd, java.util.List<ValueType> desiredType, ProgramNode actual, double minValue, double maxValue)Randomize this actual tree node.- Parameters:
rnd- Random number generator.desiredType- The desired type of the randomization, if allowed.actual- The actual program node to randomize.minValue- The minimum value to use for randomization.maxValue- The maximum value to use for randomization.
-
-
DMelt 3.0 © DataMelt by jWork.ORG