org.nlogo.nvm
Class Context

java.lang.Object
  extended by org.nlogo.nvm.Context
All Implemented Interfaces:
Cloneable

public final class Context
extends Object
implements Cloneable


Field Summary
 Activation activation
           
 Agent agent
           
 int agentBit
           
 boolean finished
           
 int ip
           
 Job job
           
 Agent myself
           
 boolean stopping
          It is necessary for each Context to have its own stopping flag in order to support the hack where if the last procedure call in a forever button's code exits via "stop", then the forever button stops too.
 boolean waiting
           
 
Constructor Summary
Context(Context context)
           
Context(Job job, Agent agent, int ip, Activation activation)
           
 
Method Summary
 boolean atTopActivation()
          used for determining whether we are inside an ask inside the current procedure or not
 String buildRuntimeErrorMessage(Instruction instruction, Throwable throwable)
           
 Object callReporterProcedure(Activation newActivation)
           
 double evaluateDoubleReporter(Agent agent, DoubleReporter reporter)
           
 Object evaluateReporter(Agent agent, Reporter reporter)
           
 Object getLet(Let let)
           
 boolean hasParentContext()
           
 void let(Let let, Object value)
           
 boolean makeChildrenExclusive()
           
 Job makeConcurrentJob(AgentSet agentset)
           
 Agent myself()
           
 void returnFromProcedure()
           
 void runExclusiveJob(AgentSet agentset, int address)
           
 void setLet(Let let, Object value)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

job

public final Job job

myself

public Agent myself

agent

public Agent agent

agentBit

public int agentBit

ip

public int ip

activation

public Activation activation

waiting

public boolean waiting

stopping

public boolean stopping
It is necessary for each Context to have its own stopping flag in order to support the hack where if the last procedure call in a forever button's code exits via "stop", then the forever button stops too. This is different from the stopping flag in Job, which is used for when the user stops a forever button by clicking on it.


finished

public boolean finished
Constructor Detail

Context

public Context(Job job,
               Agent agent,
               int ip,
               Activation activation)

Context

public Context(Context context)
Method Detail

makeChildrenExclusive

public boolean makeChildrenExclusive()

hasParentContext

public boolean hasParentContext()

myself

public Agent myself()

atTopActivation

public boolean atTopActivation()
used for determining whether we are inside an ask inside the current procedure or not


runExclusiveJob

public void runExclusiveJob(AgentSet agentset,
                            int address)
                     throws LogoException
Throws:
LogoException

makeConcurrentJob

public Job makeConcurrentJob(AgentSet agentset)

returnFromProcedure

public void returnFromProcedure()

evaluateReporter

public Object evaluateReporter(Agent agent,
                               Reporter reporter)
                        throws LogoException
Throws:
LogoException

evaluateDoubleReporter

public double evaluateDoubleReporter(Agent agent,
                                     DoubleReporter reporter)
                              throws LogoException
Throws:
LogoException

callReporterProcedure

public Object callReporterProcedure(Activation newActivation)
                             throws LogoException
Throws:
LogoException

let

public void let(Let let,
                Object value)

getLet

public Object getLet(Let let)

setLet

public void setLet(Let let,
                   Object value)

toString

public String toString()
Overrides:
toString in class Object

buildRuntimeErrorMessage

public String buildRuntimeErrorMessage(Instruction instruction,
                                       Throwable throwable)