-
Notifications
You must be signed in to change notification settings - Fork 3
Select Action Tech Note
mint.sm-meta.action.tn.9 / Leon Starr / Version 0.2.0 / 22-4-14
To select subset of instances from a class we apply the instance filter action.
Inputs to this action are a single Class and a filter expression. The output is an instance flow.
Let's consider an example taken from the Scrall documentation.
high and fast aircraft ..= Aircraft( Altitude > high alt and Airspeed > min fast speed )
The data flow diagram for this statement looks like this:
The filter expression is composed by a separate predicate expression domain. Metamodeling has little to do with this subject matter so we don't attempt to incorporate predicate building into our metamodeling domain. We are responsible for identifying the expression inputs and configuring the necessary comparison operators.
The filter expression is built using an external domain represented by the gray box in the figure above.
Under certain circumstances we can be assured that only one or zero instances will ever be selected. Let's say, for example, that our selection criteria includes an identifier of the source class.
my lead aircraft .= Aircraft( Tail number: in.lead aircraft id )
There is one other circumstance where zero or one instance is guaranteed. That's when a one
cardinality limitation is supplied.
some aircraft .= Aircraft(1)
In the example above, no filter expression is required since we want (for some reason) to select an arbitrary instance of Aircraft. Even if a filter expression were provided such as...
high aircraft .= Aircraft(1, Altitude > ceiling ) // One cardinality with criteria
...we are still assured that at most one instance will be selected.
When no cardinality is specified, the default assumption is all
. In other words, we select all instances meeting our filter expression criteria unless an alternate cardinality value is specified.
Copyright © 2021-2023 Leon Starr