Skip to content

Simulating the light switch

  1. Right-click on 01_lightSwitch.ysc and select Run As → Statechart Simulation in the context menu.
  2. The simulation starts and shows the light switch model in its off state. The rectangle named Off is highlighted in yellow, meaning it is the active state.

    Light switch simulation in "off" state

  1. At the right side of the window, the simulation view is located. In this view, you can change variable values and raise events during a simulation run. Click on the small triangle left from default to unfold the switch link. This link represents the switch event to switch the light on or off.

    Simulation View with the switch event

  2. Click on the switch link. The active state changes accordingly from Off to On.

    Light switch simulation in "on" state

  3. Click on switch again to switch off the light.