<p>An actor that stops execution of a model when it receives a true
token on any input channel. This is accomplished by calling
finish() on the director, which requests that the current iteration
be completed and then the execution be halted. This actor will
also call stopFire() which requests that any actors that are
firing concurrently in separate threads conclude their firings.
This is necessary to support threaded domains like PN. If the input
is not connected to anything, then this actor requests a stop
whenever it fires.
</p><p>
When exactly this stops the execution depends on the domain. For
example, in DE, if an event with time stamp <i>T</i> and value
<i>true</i> arrives at this actor, then the current iteration will
be concluded, and then the model will halt. Concluding the current
iteration means processing all events in the event queue with time
stamp <i>T</i>. Thus, it is possible for actors to be invoked after
this one is invoked with a <i>true</i> input.
</p><p>
In SDF, if this actor receives <i>true</i>, then the current
iteration is concluded and then execution is stopped. Similarly in
SR.
</p><p>
In PN, where each actor has its own thread, there is no
well-defined notion of an iteration. The finish() method of the
manager calls stopFire() on all actors, which for threaded actors
results in halting them upon their next attempt to read an input or
write an output. When all actor threads have stopped, the iteration
concludes and the model halts. <b>NOTE</b>: <i>This is not the best
way to stop a PN model!</i> This mechanism is nondeterministic in
the sense that there is no way to control exactly what data is
produced or consumed on the connections before the model stops. To
stop a PN model, it is better to design the model so that all
actors are starved of data when the model is to stop. The director
will detect this starvation, and halt the model. Nonetheless, if
the nondeterminism is acceptable, this actor can be used.</p>
Edward A. Lee
$Id: Stop.java 70398 2014-10-22 23:44:32Z cxh $
Ptolemy II 2.1
Green (eal)
Green (neuendor)
The parameter that hides the name of the actor. The default
value is true.