예제 #1
0
 public void perform_1(Context context) throws LogoException {
   if (context.atTopActivation()) {
     context.ip = offset;
   } else {
     // if we're inside an ask inside the current procedure, then we have
     // to do normal recursion, not "fast" tail recursion - ST 11/17/04
     original.perform(context);
   }
 }
예제 #2
0
 // identical to perform_1() above... BUT with a profiling hook added
 public void profiling_perform_1(final org.nlogo.nvm.Context context) {
   if (!context.atTopActivation()) {
     context.finished = true;
   } else {
     if (context.activation.procedure().isReporter()
         || context.activation.procedure().isTask()
             && context.activation.procedure().parent().isReporter()) {
       throw new EngineException(
           context,
           this,
           I18N.errorsJ()
               .getN("org.nlogo.prim.etc._stop.notAllowedInsideToReport", displayName()));
     }
     workspace.profilingTracer().closeCallRecord(context, context.activation);
     context.stop();
   }
 }
예제 #3
0
 public void perform_1(final org.nlogo.nvm.Context context) {
   // check: are we in an ask?
   if (!context.atTopActivation()) {
     // if so, then "stop" means that this agent prematurely
     // finishes its participation in the ask.
     context.finished = true;
   } else {
     // if we're not in an ask, then "stop" means to exit this procedure
     // immediately.  first we must check that it's a command procedure
     // and not a reporter procedure.
     if (context.activation.procedure().isReporter()
         || context.activation.procedure().isTask()
             && context.activation.procedure().parent().isReporter()) {
       throw new EngineException(
           context,
           this,
           I18N.errorsJ()
               .getN("org.nlogo.prim.etc._stop.notAllowedInsideToReport", displayName()));
     }
     context.stop();
   }
 }