Ejemplo n.º 1
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();
   }
 }
Ejemplo n.º 2
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();
   }
 }