SRDirector
ptolemy.domains.sr.kernel.SRDirector

A director for the Synchronous Reactive (SR) model of computation. In SR, both computation and communication are considered to happen instantaneously. In models with cycles, this introduces interesting issues involving instantaneous feedback. <p> SR is an untimed domain, so it has no notion of the passage of time. Computation happens in a series of instants. An instant is one iteration of the director. If SR is embedded inside a timed domain, the SR director will inherit the current time of the outside director. <p> In SR, each iteration begins with the values on all channels being unknown. To ensure that an iteration converges to final values in finite time, it is required that values change only from unknown to known, and never the other way around. Once a value is set (or cleared), it must not change again in the course of the iteration. <p> An actor is considered <i>ready to fire</i> if sufficient known inputs are available. In a sense, an actor firing is triggered by these known inputs, because the director only fires an actor if it is ready to fire. Unless an actor contains an attribute called "_nonStrictMarker", it is assumed to be a strict actor, meaning that it requires all of its inputs to be known before it is fired. This is very important since once an actor defines a particular output, it is not allowed to change that value in a subsequent firing in the course of the iteration. A nonstrict actor can fire even if no inputs are known, and may fire any number of times in the course of an iteration. Thus, a nonstrict actor can be used to produce an initial token in a cyclic graph. Since strict actors are only fired if all of their inputs are known, a given strict actor is only fired once in a given iteration. An actor <i>has completed firing</i> if it has defined all of its outputs. <p> An actor is considered <i>allowed to fire</i> if its prefire() method has returned true. An actor is considered <i>allowed to iterate</i> if its postfire() method has not returned false. <p> A scheduler returns an ordering of the actors. SR semantics do not require any specific ordering of actor firings, but a particular ordering may be desirable in an attempt to reduce the computation time required for a given iteration to converge. If the scheduler is an SRRandomizedScheduler, in the course of an iteration, the director cycles through the schedule repeatedly, firing those actors that are allowed to fire and ready to fire. If the scheduler is an SROptimizedScheduler, the director makes only one pass through the schedule, since it guarantees the convergence of the iteration. <p> For an actor to be valid in the SR domain, its prefire() method must be monotonic. In other words, once the prefire() method of an actor returns true in a given iteration, this method must not return false if it were to be called again in the same iteration. It is only possible for the number of known inputs of an actor to increase in a given iteration, so, for example, if the prefire() method of an actor returns true and then more inputs become known, the method must return true if it were to be called again. If this were not the case, the behavior of the model would be nondeterministic since the execution results would depend on the order of the schedule. <p> An iteration <i>has converged</i> if both the total number of known outputs and the number of actors that are allowed to fire have converged. In other words, the system is executed until the values in the model reach a <i>fixed-point</i>. Further execution would not result in more defined values, and the iteration has converged.

Author(s): Paul Whitaker, Contributor: Ivan Jeukens
Version:$Id: SRDirector.doc.html,v 1.1 2006/02/22 18:41:22 mangal Exp $
Pt.Proposed Rating:Green (pwhitake)
Pt.Accepted Rating:Green (pwhitake)




iterations
The number of times that postfire may be called before it returns false. The type must be IntToken, and the value defaults to zero. If the value is less than or equal to zero, then the execution will never return false in postfire, and thus the execution can continue forever.
scheduler
The name of the scheduler to be used. The default is a String "ptolemy.domains.sr.kernel.SROptimizedScheduler". The only other valid value is "ptolemy.domains.sr.kernel.SRRandomizedScheduler".