Skip to document

Real-time system modeling

Real-time system modeling
Course

Software Engineering (CSPC 111)

140 Documents
Students shared 140 documents in this course
Academic year: 2022/2023
Uploaded by:
Anonymous Student
This document has been uploaded by a student, just like you, who decided to remain anonymous.
Don Mariano Marcos Memorial State University

Comments

Please sign in or register to post comments.

Preview text

Real-time system modeling

The events that a real-time system must react to often cause the system to move from one state to another. For this reason, state models, which I introduced in Chapter 5, are used to describe real-time systems. A state model of a system assumes that, at any time, the system is in one of a number of possible states. When a stimulus is received, this may cause a transition to a different state. For example, a system controlling a valve may move from a state “Valve open” to a state “Valve closed” when an operator command (the stimulus) is received.

State models are an integral part of real-time system design methods. The UML supports the development of state models based on Statecharts (Harel 1987, 1988). Statecharts are formal state machine models that support hierarchical states, so that groups of states can be considered as a single entity. Douglass discusses the use of the UML in real-time systems development (Douglass 1999).

I have already illustrated this approach to system modeling in Chapter 5 where I used an example of a model of a simple microwave oven. Figure 21 is another example of a state model that shows the operation of a fuel delivery software system embedded in a petrol (gas) pump. The rounded rectangles represent system states, and the arrows represent stimuli that force a transition from one state to another.

The names chosen in the state machine diagram are descriptive. The associated information indicates actions taken by the system actuators or information that is displayed. Notice that this system never terminates but idles in a waiting state when the pump is not operating.

The fuel delivery system is designed to allow unattended operation, with the following sequence of actions:

  1. The buyer inserts a credit card into a card reader built into the pump. This causes a transition to a Reading state where the card details are read and the buyer is then asked to remove the card.

  2. Removal of the card triggers a transition to a Validating state where the card is validated.

  3. If the card is valid, the system initializes the pump and, when the fuel hose is removed from its holster, transitions to the Delivering state, where is ready to deliver fuel. Activating the trigger on the nozzle causes fuel to be pumped; this stops when the trigger is released (for simplicity, I have ignored the pressure switch that is designed to stop fuel spillage).

  4. After the fuel delivery is complete and the buyer has replaced the hose in its holster, the system moves to a Paying state where the user’s account is debited.

  5. After payment, the pump software returns to the Waiting state.

State models are used in model-driven engineering, which I discussed in Chapter 5, to define the operation of a system. They can be transformed automatically or semi automatically to an executable program.

Two or more sensors positive

 Initiate alarm; turn on lights around sites of positive sensors; call police with location of suspected break-in.

Voltage drop of between 10% and 20%

 Switch to battery backup; run power supply test.

Voltage drop of more than 20%

 Switch to battery backup; initiate alarm; call police, run power supply test.

Was this document helpful?

Real-time system modeling

Course: Software Engineering (CSPC 111)

140 Documents
Students shared 140 documents in this course
Was this document helpful?
Real-time system modeling
The events that a real-time system must react to often cause the system to move from
one state to another. For this reason, state models, which I introduced in Chapter 5, are
used to describe real-time systems. A state model of a system assumes that, at any
time, the system is in one of a number of possible states. When a stimulus is received,
this may cause a transition to a different state. For example, a system controlling a
valve may move from a state “Valve open” to a state “Valve closed” when an operator
command (the stimulus) is received.
State models are an integral part of real-time system design methods. The UML
supports the development of state models based on Statecharts (Harel 1987, 1988).
Statecharts are formal state machine models that support hierarchical states, so that
groups of states can be considered as a single entity. Douglass discusses the use of the
UML in real-time systems development (Douglass 1999).
I have already illustrated this approach to system modeling in Chapter 5 where I used
an example of a model of a simple microwave oven. Figure 21.5 is another example of
a state model that shows the operation of a fuel delivery software system embedded in
a petrol (gas) pump. The rounded rectangles represent system states, and the arrows
represent stimuli that force a transition from one state to another.
The names chosen in the state machine diagram are descriptive. The associated
information indicates actions taken by the system actuators or information that is
displayed. Notice that this system never terminates but idles in a waiting state when the
pump is not operating.
The fuel delivery system is designed to allow unattended operation, with the following
sequence of actions: