-
Notifications
You must be signed in to change notification settings - Fork 0
Signal to each member of an instance set
The signaling of an event is expressed with the -> symbol. Here a signal is sent from a Cabin instance to its associated Door instance.
Unlock -> /R4/Door
One signal is sent to each instance in the target selection.
Take out of service -> my bank/R1/Shaft // All Shafts in the Bank are deactivated
The ME keyword is used when the target of the signal is the local instance.
Continue -> ME // Move self on to the next state
You need to first select the destination instances, via navigation, criteria based selection or both so that you can address the signal. If you end up with the empty set in your selection, no signal will be sent. You will often want to specify some action to be executed in the case where zero target instances were selected. You will need an instance set variable to test the cardinality as shown:
ac to land .= Aircraft( Tail number: in.aircraft to land )
Land ( Runway: designated runway ) -> ac to land
!ac to land ? No aircraft to land -> ME
The above works, but here is a more readable, and hence preferable, formulation:
ac to land .= Aircraft( Tail number: in.aircraft to land )
ac to land ?
Land ( Runway: designated runway ) -> ac to land :
No aircraft to land -> ME
Copyright 2020, 2021, 2022, 2023, 2025 © Leon Starr under MIT Open Source License
- Why they are problematic
- Instance attribute creation values
- Boolean values
- Special values
- Enumerated values
- Action block
- Statement
- Single line action
- Multiple dependent actions on a single line
- An action spread across multiple lines
- A conditional group of single line actions
- Comments
- Finding instances
- Attribute access
- Creation and deletion
- Subclass migration
- Creating a table from a class
- Creating a table with a definition
- Converting a table into a class
- Set operations on tables
- Set comparisons on tables
- Join
- Rename
- Extend
- Aggregation
- Rank
- Image
- Input values
- Signatures and name doubling
- Output values
- Execution order
- Sequential execution
- Conditional execution
- Signals
- Scrall has no for_each action
- Iteration