public void stop() { if (activation.procedure().isTask()) { throw NonLocalExit$.MODULE$; } if (activation.procedure().topLevel()) { // In the BehaviorSpace case, there are two cases: stop // used inside a procedure called from the go commands, // and stop used in the go commands themselves. (People // probably shouldn't be doing the latter, since they // could just use a stop condition, but you know somebody // will try...) If stop is used in the go commands // themselves, then the call to returnFromProcedure below // means that __experimentstepend won't run. Thus we need // to set job.stopping to true ourselves, if we just // returned from a top level procedure. If I've analyzed // this correctly, setting it to true will have no effect // in other settings besides BehaviorSpace. // - ST 3/8/06, 8/30/07 job.stopping = true; finished = true; } returnFromProcedure(); // this is so that we can stop our enclosing forever // button if we're immediately inside one. __foreverbuttonend // will be looking for this to be true and if it is, will // stop the button. this flag is reset to false by // _return and _report, so the next time a procedure // returns normally, the forever button will no longer // stop since "stop" wasn't used within a procedure called // directly by the button. - ST // It's also used to stop a BehaviorSpace run, using // __experimentstepend. - ST 3/8/06 stopping = true; }