Scalar Value - modelint/shlaer-mellor-metamodel GitHub Wiki

Certain values represent constants that do not change during model execution.

The Scrall action language forbids most constants (or at least makes them hard to specify) for a variety of good modeling practice reasons. But the Shlaer-Mellor metamodel is independent of any action language syntax, so it does permit the specification of constant values.

With Scrall, the only constants that can be directly specified are the boolean true and false values, or enumerated values such as up and down or red, green, yellow. In Scrall, for example you can do:

Out of service = TRUE // boolean constant
Travel direction = _down  // enumerated value

To specify any other constant in Scrall, you use a type selector operation such as:

circle area = Rational[pi] * r * r  // you could also use r.sqr

Here we could either convert the selector into a constant during population or pre-execution where the type selector is invoked to yield the selected value.

You are, of course, free to use or define an alternate action langauge that does specify constants in the traditional way (possibly with all the traditional downfalls).

Either way, a Scalar Value represents a value known prior to model execution that does not change during execution.

Identifiers

  1. Flow + Activity + Domain

Attributes

Name

A textual representation of the value such as pi, 2, true, 97.8. This value must be convertable into a member of the Scalar associated via R814/R806.

Type: Name -> String