org.encog.ml.prg
public class EncogProgramContext extends Object implements Serializable
Constructor and Description |
---|
EncogProgramContext()
Construct the context with an English number format and an empty function
factory.
|
EncogProgramContext(CSVFormat format)
Construct a context with the specified number format and an empty
function factory.
|
EncogProgramContext(CSVFormat theFormat,
FunctionFactory theFunctions)
Construct the context with the specified format and function factory.
|
Modifier and Type | Method and Description |
---|---|
void |
clearDefinedVariables()
Clear the defined variables.
|
ProgramNode |
cloneBranch(EncogProgram targetProgram,
ProgramNode sourceBranch)
Clone a branch of the program from the specified node.
|
EncogProgram |
cloneProgram(EncogProgram sourceProgram)
Clone an entire program, keep the same context.
|
EncogProgram |
createProgram(String expression)
Create a new program, using this context.
|
void |
defineVariable(String theName)
Define the specified variable as floating point.
|
void |
defineVariable(String theName,
ValueType theVariableType)
Define the specified variable as the specified type.
|
void |
defineVariable(String theName,
ValueType theVariableType,
int theEnumType,
int theEnumValueCount)
Define a variable.
|
void |
defineVariable(VariableMapping mapping)
Define a variable, based on a mapping.
|
List<VariableMapping> |
findVariablesByTypes(List<ValueType> desiredTypes)
Find all of the variables of the specified types.
|
List<VariableMapping> |
getDefinedVariables() |
int |
getEnumCount(int enumType)
Get the enum ordinal count for the specified enumeration type.
|
CSVFormat |
getFormat() |
FunctionFactory |
getFunctions() |
int |
getMaxEnumType()
Get the max enum type for all defined variables.
|
VariableMapping |
getResult() |
boolean |
hasEnum() |
void |
loadAllFunctions()
Load all known functions as opcodes.
|
void |
setResult(VariableMapping result) |
public EncogProgramContext()
public EncogProgramContext(CSVFormat format)
format
- The format.public EncogProgramContext(CSVFormat theFormat, FunctionFactory theFunctions)
theFormat
- The format.theFunctions
- The function factory.public void clearDefinedVariables()
public ProgramNode cloneBranch(EncogProgram targetProgram, ProgramNode sourceBranch)
targetProgram
- The program that this branch will be "grafted" into.sourceBranch
- The branch to clone, from the source program.public EncogProgram cloneProgram(EncogProgram sourceProgram)
sourceProgram
- The source program.public EncogProgram createProgram(String expression)
expression
- The common expression to compile.public void defineVariable(String theName)
theName
- The variable name to define.public void defineVariable(String theName, ValueType theVariableType)
theName
- The name of the variable.theVariableType
- The variable type.public void defineVariable(String theName, ValueType theVariableType, int theEnumType, int theEnumValueCount)
theName
- The name of the variable.theVariableType
- The type of variable.theEnumType
- The enum type, not used if not an enum type.theEnumValueCount
- The number of values for the enum, not used if not an enum
type.public void defineVariable(VariableMapping mapping)
mapping
- The variable mapping.public List<VariableMapping> findVariablesByTypes(List<ValueType> desiredTypes)
desiredTypes
- The types to look for.public List<VariableMapping> getDefinedVariables()
public int getEnumCount(int enumType)
enumType
- The enumeration type.public CSVFormat getFormat()
public FunctionFactory getFunctions()
public int getMaxEnumType()
public VariableMapping getResult()
public boolean hasEnum()
public void loadAllFunctions()
public void setResult(VariableMapping result)
result
- the result to setCopyright © 2014. All Rights Reserved.