Example Use Case
The Moxie installation includes two sample projects: one for the completed tutorials and one that is a simplified example of a hot air balloon ride. This balloon ride example uses idealized, one-dimensional physics instead of delegating the physics to an analysis tool like STK. Doing so allows it to focus on how Moxie executes SysML models, especially how it handles events.
The hot air balloon ride simulation consists of just a balloon, a balloon operator, and a passenger, as shown in Figure 1:
Figure 1: The block definition diagram for the hot air balloon ride
Figure 2 shows the simulation's state machines. The steps they execute are as follows:
- The balloon operator waits for a passenger's specific appointment time (an absolute time event) before telling the passenger to embark (using a call event).
- At that time, the operator launches the balloon (due to another call event) by activating the balloon's burner, causing the balloon to begin its ascent, as modeled in the balloon's delegate class.
- Once the balloon achieves the target altitude (a change event), the operator turns off the burner.
- When not operating the burner, the operator permits the passenger to take a photo (using a signal event and guard).
- Without the burner on, the balloon eventually loses altitude, as modeled in the balloon's delegate class.
- Once the balloon passes below the target altitude (another change event), the operator turns the burner
on again, interrupting the passenger (using another signal event) if the passenger has not yet finished
taking a photo.
A passenger being unsatisfied with a photo because of a safety protocol is a simple example of how a system might unexpectedly fail to accomplish its mission. This is why actually simulating the behavior of your system instead of merely describing it is so important, because it allows you to identify emergent behaviors like this early enough in the development lifecycle of your system for you to easily make changes.
- The balloon oscillates about its target altitude until the maximum flight duration expires (a relative time event), at which point the balloon operator begins to land the balloon (due to another call event) by turning off the burner.
- After landing (communicated by another signal event), the balloon operator tells the passenger to disembark (using another call event), and then awaits the next passenger.
Figure 2: The operator and passenger state machines for the hot air balloon ride