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, waitevaluatepublic 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 ProgramExtensionTemplatepublic int getDataSize()
getDataSize in interface ProgramExtensionTemplatepublic String getName()
getName in interface ProgramExtensionTemplatepublic NodeType getNodeType()
getNodeType in interface ProgramExtensionTemplatepublic List<ParamTemplate> getParams()
getParams in interface ProgramExtensionTemplatepublic int getPrecedence()
getPrecedence in interface ProgramExtensionTemplatepublic ParamTemplate getReturnValue()
getReturnValue in interface ProgramExtensionTemplatepublic String getSignature()
public boolean isPossibleReturnType(EncogProgramContext context, ValueType rtn)
isPossibleReturnType in interface ProgramExtensionTemplatecontext - The program context.rtn - The potential return type to check.public boolean isVariable()
isVariable in interface ProgramExtensionTemplatepublic void randomize(Random rnd, List<ValueType> desiredTypes, ProgramNode actual, double minValue, double maxValue)
randomize in interface ProgramExtensionTemplaternd - 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.