|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectec.gp.GPNode
ec.gp.ERC
ac.essex.ooechs.ecj.ecj2java.nodes.ParseableERC
ac.essex.ooechs.ecj.ecj2java.example.terminals.Number
public class Number
This is a simple ERC class that returns a number in the range -5 to 5. It is an extension of the parseableERC class which demands it implement two methods - setNumber() and name(), the former to choose which random numbers it wants, and the second to provide it with a unique name for ECJ to use.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version, provided that any use properly credits the author. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at http://www.gnu.org
Field Summary |
---|
Fields inherited from class ac.essex.ooechs.ecj.ecj2java.nodes.ParseableERC |
---|
type, value |
Fields inherited from class ec.gp.ERC |
---|
ERC_PREFIX |
Fields inherited from class ec.gp.GPNode |
---|
argposition, children, constraints, GPNODEPRINTTAB, MAXPRINTBYTES, NODESEARCH_ALL, NODESEARCH_CUSTOM, NODESEARCH_NONTERMINALS, NODESEARCH_TERMINALS, P_NODE, P_NODECONSTRAINTS, parent, REPLACEMENT_CHAR, SITUATION_MUTATION, SITUATION_NEWIND |
Fields inherited from interface ac.essex.ooechs.ecj.ecj2java.nodes.ParseableNode |
---|
BOOLEAN, DOUBLE, ERC, FUNCTION, INT, RETURN, VOID |
Constructor Summary | |
---|---|
Number()
|
Method Summary | |
---|---|
int |
getObjectType()
The kind of object this is, eg int, double, etc. |
java.lang.String |
name()
The name of the class that ECK uses. |
double |
setNumber(ec.EvolutionState state,
int thread)
Set the value of the ERC here |
Methods inherited from class ac.essex.ooechs.ecj.ecj2java.nodes.ParseableERC |
---|
countChildren, decode, encode, eval, getChild, getJavaCode, getLineComment, getType, getValue, getVariableName, mutateERC, nodeEquals, nodeHashCode, readNode, resetNode, setType, setValue, setVariableName, toStringForHumans, writeNode |
Methods inherited from class ec.gp.ERC |
---|
checkConstraints, readNode, toString |
Methods inherited from class ec.gp.GPNode |
---|
atDepth, cloneReplacing, cloneReplacing, cloneReplacing, cloneReplacingAtomic, cloneReplacingAtomic, cloneReplacingAtomicSimple, cloneReplacingAtomicSimple, cloneReplacingNoSubclone, cloneReplacingNoSubcloneSimple, cloneReplacingSimple, cloneReplacingSimple, cloneReplacingSimple, constraints, contains, defaultBase, depth, errorInfo, makeCTree, makeLatexTree, nodeEquivalentTo, nodeInPosition, numNodes, numNodes, parentType, printNode, printNode, printNodeForHumans, printRootedTree, printRootedTree, printRootedTreeForHumans, protoClone, protoCloneSimple, readRootedTree, readRootedTree, replaceWith, rootedTreeEquals, rootedTreeHashCode, rootParent, setup, swapCompatibleWith, toStringForError, writeRootedTree |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Number()
Method Detail |
---|
public double setNumber(ec.EvolutionState state, int thread)
ParseableERC
setNumber
in class ParseableERC
public int getObjectType()
ParseableNode
public java.lang.String name()
ParseableERC
name
in class ParseableERC
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |