Batch Mode Simulation : The Simulation Control Program : Basic Syntax Rules : Rational Statemate Expressions In the Simulation Control Program

Rational Statemate Expressions In the Simulation Control Program

In order to interact with the simulated system model, the Simulation Control Program must be able to detect the system status. It must also be able to change the system status by performing actions on the specification elements. Rational Statemate expressions are used in the SCL for this purpose.

When used in a Simulation Control Program, Rational Statemate expressions can reference both specification elements and SCL variables and constants.

Two types of Rational Statemate expressions are used in the SCL:

Rational Statemate Actions: These are equivalent to the interactive mode input commands used to generate external changes. For example:

if c then st!(A) else st!(B) end if

a1 ; a2 ; a3

where c is a condition, A and B are activities and a1, a2 and a3 are actions.
Rational Statemate Triggers: In most executions, it is useful to trigger the execution of some actions either conditionally or as the direct result of some event. Such triggers are written as Rational Statemate expressions and are used as part of an SCL structured statement.

Some examples:

if c then . . .

when condition c is true, then take actions . . .

when tr(c) then . . .

if the condition c becomes true during the last execution step, then . . .

set breakpoint ch(i) do . . .

sets a breakpoint when a data-item i has changed value during the last execution step

while c loop . . .

when condition c is true, trigger actions in a loop

When writing a Rational Statemate expression, remember to follow the rules outlined in the Rational Statemate User Guide. Some exceptions apply:

Events true(v) and false(v), where v is an SCL Boolean variable

Your workarea must contain the specification elements referenced in expressions in the Simulation Control Program. Although these elements need not be in the current scope, the references must be unique.