org.encog.ml.prg.extension
public class FunctionFactory extends Object implements Serializable
Constructor and Description |
---|
FunctionFactory()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addExtension(ProgramExtensionTemplate ext)
Add an opcode to the function factory.
|
void |
addExtension(String name,
int args)
Add an opcode to the function factory from the opcode registry.
|
ProgramNode |
factorProgramNode(ProgramExtensionTemplate temp,
EncogProgram program,
ProgramNode[] args)
Factor a new program node, based in a template object.
|
ProgramNode |
factorProgramNode(String name,
EncogProgram program,
ProgramNode[] args)
Factor a new program node, based on an opcode name and arguments.
|
ProgramExtensionTemplate |
findFunction(String name)
Find a function with the specified name.
|
List<ProgramExtensionTemplate> |
findOpcodes(List<ValueType> types,
EncogProgramContext context,
boolean includeTerminal,
boolean includeFunction)
Find all opcodes that match the search criteria.
|
ProgramExtensionTemplate |
findOperator(char ch1,
char ch2)
This method is used when parsing an expression.
|
ProgramExtensionTemplate |
getOpCode(int theOpCode)
Get the specified opcode.
|
List<ProgramExtensionTemplate> |
getOpCodes() |
Map<String,ProgramExtensionTemplate> |
getTemplateMap() |
boolean |
isDefined(String name,
int l)
Determine if an opcode is in the function factory.
|
int |
size() |
public void addExtension(ProgramExtensionTemplate ext)
ext
- The opcode to add.public void addExtension(String name, int args)
name
- The name of the opcode.args
- The number of arguments.public ProgramNode factorProgramNode(ProgramExtensionTemplate temp, EncogProgram program, ProgramNode[] args)
temp
- The opcode.program
- The program.args
- The arguments for this node.public ProgramNode factorProgramNode(String name, EncogProgram program, ProgramNode[] args)
name
- The name of the opcode.program
- The program to factor for.args
- The arguements.public ProgramExtensionTemplate findFunction(String name)
name
- The name of the function.public List<ProgramExtensionTemplate> findOpcodes(List<ValueType> types, EncogProgramContext context, boolean includeTerminal, boolean includeFunction)
types
- The return types to consider.context
- The program context.includeTerminal
- True, to include the terminals.includeFunction
- True, to include the functions.public ProgramExtensionTemplate findOperator(char ch1, char ch2)
ch1
- The first character of the potential operator.ch2
- The second character of the potential operator. Zero if none.public ProgramExtensionTemplate getOpCode(int theOpCode)
theOpCode
- The opcode index.public List<ProgramExtensionTemplate> getOpCodes()
public Map<String,ProgramExtensionTemplate> getTemplateMap()
public boolean isDefined(String name, int l)
name
- The name of the opcode.l
- The argument count for the opcode.public int size()
Copyright © 2014. All Rights Reserved.