Dynamic Dataflow Modeling in Ptolemy II - Ptolemy Project ...
Dynamic Dataflow Modeling in Ptolemy II - Ptolemy Project ...
Dynamic Dataflow Modeling in Ptolemy II - Ptolemy Project ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
satisfy requiredFir<strong>in</strong>gsPerIteration for the actors with that parameter, (3) repeat<strong>in</strong>g a<br />
basic iteration until the submodel is deadlocked. Among these three def<strong>in</strong>itions, (2)<br />
overrides (1), (3) overrides (1) and (2). Also notice that while def<strong>in</strong>ition (1) and (2) are<br />
also applicable for top level DDF models, def<strong>in</strong>ition (3) is only applicable for embedded<br />
DDF submodels.<br />
We also have the follow<strong>in</strong>g rules for transferr<strong>in</strong>g tokens <strong>in</strong>to and out of DDF submodels.<br />
If the user manually adds tokenConsumptionRate and tokenProductionRate parameters to<br />
the <strong>in</strong>put ports and output ports of the DDF composite actor, the local DDFDirector will<br />
leave them as they are and obey them assum<strong>in</strong>g the user knows the consequence of<br />
his(her) actions. If the rates of some ports are not manually def<strong>in</strong>ed, the local<br />
DDFDirector will try to def<strong>in</strong>e them <strong>in</strong> a reasonable way. For the <strong>in</strong>put port, the<br />
tokenConsumptionRate is set to the m<strong>in</strong>imum number of tokens needed to satisfy one of<br />
dest<strong>in</strong>ation actors connected to this <strong>in</strong>put port. Therefore the rate could be zero if one of<br />
dest<strong>in</strong>ation actors already has enough tokens on the channel connected to this <strong>in</strong>put port.<br />
However, if no actor <strong>in</strong> the DDF composite actor gets fired dur<strong>in</strong>g the previous iteration,<br />
the tokenConsumptionRate is set to the m<strong>in</strong>imum number of tokens needed to satisfy one<br />
of dest<strong>in</strong>ation actors that are connected to this <strong>in</strong>put port and haven’t been satisfied on the<br />
connect<strong>in</strong>g channels. The motivation beh<strong>in</strong>d this seem<strong>in</strong>gly complicated procedure is to<br />
try to break a deadlock us<strong>in</strong>g m<strong>in</strong>imum number of tokens. When every dest<strong>in</strong>ation actor<br />
connected to this <strong>in</strong>put port has been satisfied and the submodel is still deadlocked <strong>in</strong> the<br />
previous iteration, the tokenConsumptionRate of this <strong>in</strong>put port is set to zero. For the<br />
output port (which has no tokenProductionRate parameter added by the user), the local<br />
DDFDirector will not set the rate for this output port because <strong>in</strong> general there is no way<br />
48