Rate Triggered Transition

Statechart transition with trigger of type rate. A rate is a form of updatable exponential timeout. Such transition is executed with the timeout distributed exponentially with the parameter rate (counted from the moment the statechart came to the transition's source state), i.e. if the rate is 5, the transition will be executed on average 5 times per time unit. Rate triggered transition is depicted by the icon .

 To define a rate triggered transition

  1. Select the transition in the graphical editor.
  2. In the Properties view, choose Rate from the Triggered by drop-down list.
  3. Specify the rate value in the Rate edit box below.

If the rate changes dynamically, the timeout gets re-evaluated; such changes may only be noticed by transition if onChange() is called for the agent.

Functions

boolean isActive() - Returns true, if the transition is currently scheduled, false otherwise. 

double getRest() - Returns the time remaining before the scheduled occurrence of the transition, in model time units.
If the transition is not scheduled, the function returns Double.POSITIVE_INFINITY.

double getRest(TimeUnits units) - Returns the time remaining before the scheduled occurrence of the transition, in given time units
If the transition is not scheduled, the function returns Double.POSITIVE_INFINITY.
Parameter: units - time unit constant

Example: transition.getRest(MINUTE) will return the remaining time in minutes.


Related topics

 Statecharts

 Transition

 Triggering a transition