Behavior : State Machine Diagrams - Transitions - Simple State Machine

4 important questions on Behavior : State Machine Diagrams - Transitions - Simple State Machine

We have an example of a Simple State Machine: A standard Light switch.

  • This switch is often called an SPST switch (Single Pole Single Throw).
  • In US terminology, it is called a two-way switch (ON/OFF).
  • In British terminology, this is a one-way switch (only controlling one circuit).

   
Which state(s) and event(s) do we have?

There are two states (Light ON/Light OFF)

and

two events: Switch Turned On and Switch Turned Off.


The events are placed on the necessary transitions,

As in most State Machine Diagrams, the destination state depends on the originating state and the triggering event.
Report

Example 2 of the Light switch.

Which state(s) and event(s) do we have?

there is only one event used.

1 Event = Switch flipped

2 States : Light On and Light Off


In this case, the target state only depends on the source state.
Report

The light switch diagrams are so simple that many methodologists would say that it is not necessary to model.

You should be concentrating your efforts where ....?

you hope to gain new insight or to address your biggest risks.


Of course, if you hope your model will help you automatically to generate the run-time code or to be used for system simulation, you will even have to model simple switches or retrieve them from a model library
Report

Example of a more complicated switch : Single Pole Double Throw

  • In US terminology, it is called a three-way switch (ON/OFF/ON).
  • In British terminology, this is a two-way switch (controlling two circuits).
   
Name the:

  • Event(s)
  • State(s)
  • explain what the ball with the pointer means


2 Events: Turn A off    and  Turn B On

3 States:  Light A On  ,  Both Off    and Light B On 


The ball with the pointer:    This is a Initial Pseudostate

We added a ball with a pointer to the Both Off state.

This ball and pointer is an INITIAL PSEUDOSTATE that indicates which of the states the object is in when the object is first created.
Report

The question on the page originate from the summary of the following study material:

  • A unique study and practice tool
  • Never study anything twice again
  • Get the grades you hope for
  • 100% sure, 100% understanding
Remember faster, study better. Scientifically proven.
Trustpilot Logo
  • Higher grades + faster learning
  • Never study anything twice
  • 100% sure, 100% understanding
Discover Study Smart