org.encog.ml.prg.extension
public abstract class BasicTemplate extends Object implements ProgramExtensionTemplate
NO_PREC
Constructor and Description |
---|
BasicTemplate(int thePrecedence,
String theSignature,
NodeType theType,
boolean isVariable,
int theDataSize)
Construct a basic template object.
|
BasicTemplate(String theSignature)
Construct a function based on the provided signature.
|
Modifier and Type | Method and Description |
---|---|
int |
getChildNodeCount() |
int |
getDataSize() |
String |
getName() |
NodeType |
getNodeType() |
List<ParamTemplate> |
getParams() |
int |
getPrecedence() |
ParamTemplate |
getReturnValue() |
String |
getSignature() |
boolean |
isPossibleReturnType(EncogProgramContext context,
ValueType rtn)
Determines if the specified return type is a possible return type.
|
boolean |
isVariable() |
void |
randomize(Random rnd,
List<ValueType> desiredTypes,
ProgramNode actual,
double minValue,
double maxValue)
Randomize this actual tree node.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
evaluate
public BasicTemplate(int thePrecedence, String theSignature, NodeType theType, boolean isVariable, int theDataSize)
thePrecedence
- The precedence.theSignature
- The opcode signature.theType
- The opcode type.isVariable
- True, if this opcode is a variable.theDataSize
- The data size kept for this opcode.public BasicTemplate(String theSignature)
theSignature
- The signature.public int getChildNodeCount()
getChildNodeCount
in interface ProgramExtensionTemplate
public int getDataSize()
getDataSize
in interface ProgramExtensionTemplate
public String getName()
getName
in interface ProgramExtensionTemplate
public NodeType getNodeType()
getNodeType
in interface ProgramExtensionTemplate
public List<ParamTemplate> getParams()
getParams
in interface ProgramExtensionTemplate
public int getPrecedence()
getPrecedence
in interface ProgramExtensionTemplate
public ParamTemplate getReturnValue()
getReturnValue
in interface ProgramExtensionTemplate
public String getSignature()
public boolean isPossibleReturnType(EncogProgramContext context, ValueType rtn)
isPossibleReturnType
in interface ProgramExtensionTemplate
context
- The program context.rtn
- The potential return type to check.public boolean isVariable()
isVariable
in interface ProgramExtensionTemplate
public void randomize(Random rnd, List<ValueType> desiredTypes, ProgramNode actual, double minValue, double maxValue)
randomize
in interface ProgramExtensionTemplate
rnd
- Random number generator.desiredTypes
- 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.Copyright © 2014. All Rights Reserved.