COMP 400 Presentation

12 December 2003

Modelling and Simulation Based Design

Alison Stewart

Modelling, Simulation and Design Lab (MSDL)

School of Computer Science, McGill University,

Montreal, Canada

Presentation Overview

•	Statecharts

◦	State Automata

◦	Hierarchy

◦	Concurrency

◦	Adding State Variables and Actions as Output Events

◦	MP3 Player Example

•	DEVS

◦	Scheduling

◦	Modularity

◦	MP3 Player Example

•	Subject Observer Pattern

•	Statecharts and DEVS Combined

•	Conclusion

STATECHARTS = State Automata

STATECHARTS = State Automata + Hierarchy

STATECHARTS =

State Automata + Hierarchy + Concurrency

Extending Statecharts with Variables and Actions in Output Events

Statechart MP3 Player Example

c

\postscript{MP3PlayerSC.eps}{1}

\vfill

DEVS - Discrete EVent System

•	DEVS is a more powerful modelling formalism than statecharts.

•	In DEVS the state is also considered, but time is considered more explicitly.

•	Within an Atomic DEVS events are scheduled.

DEVS - Discrete EVent System

•	A very important idea in DEVS is modularity.

•	A message is not seen by all parts of the system, it must be specifically passed.

•	Two linked (coupled) Atomic DEVS can be considered as concurrent components. They work independently until a message is passed.

DEVS MP3 Player Example

c

\postscript{MP3PlayerDEVS.eps}{1}

\vfill

Subject Observer Pattern

Image from Design Patterns

•	The subject stores the state of the application and notifies observers when the state changes.

Statecharts and DEVS Combined

Editor Example

Statecharts and DEVS Combined

Editor Example:

Network

Statecharts and DEVS Combined

Editor Example:

Subject

Statecharts and DEVS Combined

Editor Example:

User

Statecharts and DEVS Combined

Editor Example:

Observer

c

Conclusion

•	Statecharts provide a very intuitive visualisation of applications.

•	The modularity of DEVS promotes the design goal of encapsulation.

•	Modelling software allows the designer to clearly consider different options before coding begins.

•	Modelling software makes design communication easier.

•	I would like to thank Prof. Vangheluwe and Thomas Feng for their help with my project.