next up previous contents index
Next: 4. GRAPHICAL SYNTAX AND Up: 3. Timing Previous: 3.2 Virtual-time Simulation   Contents   Index


3.3 Special Event: $after$

In DCharts, $after$ is regarded as a special event. It is comparable to the $tm$ (timeout) in David Harel's STATEMATE statecharts. Though it appears in the event part $E$ of a transition, it is not really an event but a schedule request. It also has a special syntax $after(t)$ where $t$ is the schedule time (in seconds) as a parameter. For example, if $t$ is $10$, the transition with such an $E$ will be triggered after 10 seconds in real-time (if the model stays in its $SRC$ state).

The meaning of ``after 10 seconds'' must be clarified. $SRC$ is the source state of transition $t$. When the model changes to $SRC$ or any substate of $SRC$ from the outside, transitions from $SRC$ with $after(t)$ events are collected. Their scheduled times $t$ are evaluated. The $t$ is usually a constant float number. However, a specific implementation may allow to use expressions to specify $t$. Those expressions are evaluated at run-time. Each of such transitions will be triggered after the resulting number of seconds, counting from the moment when the $t$ of all those transitions are evaluated. Of course, there might be slight difference in the timing of those transitions. The accuracy is implementation-dependent.

When the model leaves state $SRC$, the scheduled transitions from $SRC$ or its substates that have not been triggered yet, are canceled. In particular, if Harel's algorithm for firing a transition (section 2.3.1) is used, scheduled transitions from $SRC$ are re-scheduled when a self-loop on $SRC$ is triggered (because $CCS(SRC,SRC)$ is the parent of $SRC$); if the alternate algorithm (section 2.3.2) is used, they are not re-scheduled or canceled (because $CCS_{alt}(SRC,SRC)$ is $SRC$ itself).


next up previous contents index
Next: 4. GRAPHICAL SYNTAX AND Up: 3. Timing Previous: 3.2 Virtual-time Simulation   Contents   Index
Thomas Huining Feng 2004-04-28