public abstract class PushInstruction extends org.spiderland.Psh.Instruction implements Prototype
PushInstruction is a Prototype, so you may with also to override setup() to set up your instruction initially.
Default Base
gp.push.func
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
P_INSTRUCTION |
Constructor and Description |
---|
PushInstruction() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates a new individual cloned from a prototype,
and suitable to begin use in its own evolutionary
context.
|
Parameter |
defaultBase()
Returns the default base for this prototype.
|
abstract void |
Execute(org.spiderland.Psh.Interpreter interpreter) |
void |
setup(EvolutionState state,
Parameter base)
Sets up the object by reading it from the parameters stored
in state, built off of the parameter base base.
|
public static final java.lang.String P_INSTRUCTION
public Parameter defaultBase()
Prototype
defaultBase
in interface Prototype
public void setup(EvolutionState state, Parameter base)
Prototype
For prototypes, setup(...) is typically called once for the prototype instance; cloned instances do not receive the setup(...) call. setup(...) may be called more than once; the only guarantee is that it will get called at least once on an instance or some "parent" object from which it was ultimately cloned.
public java.lang.Object clone()
Prototype
Typically this should be a full "deep" clone. However, you may share certain elements with other objects rather than clone hem, depending on the situation:
Implementations.
public Object clone()
{
try
{
return super.clone();
}
catch ((CloneNotSupportedException e)
{ throw new InternalError(); } // never happens
}
public Object clone()
{
try
{
MyObject myobj = (MyObject) (super.clone());
// put your deep-cloning code here...
}
catch ((CloneNotSupportedException e)
{ throw new InternalError(); } // never happens
return myobj;
}
public Object clone()
{
MyObject myobj = (MyObject) (super.clone());
// put your deep-cloning code here...
return myobj;
}
public abstract void Execute(org.spiderland.Psh.Interpreter interpreter)
Execute
in class org.spiderland.Psh.Instruction