Simulating the light switch

  1. Right-click on 01_light_switch.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 operate link. This link represents the operate event to switch the light on or off.

    Simulation View with the operate event

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

    Light switch simulation in "on" state

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