CS433Modeling and Simulation
Lecture 01
Introduction
1
Dr. Anis Koubâa
Al-Imam Mohammad Ibn Saud UniversityAl-Imam Mohammad Ibn Saud University
http://10.2.230.10:4040/akoubaa/cs433/
19 Oct 2008
2
Who I Am?2
Dr. Anis Koubâa Assistant Professor at CS Dept. Research Associate at ISEP/IPP-HURRAY!
(Portugal) Email (Teaching): [email protected] Phone: 25 81 921
Background PhD from INPL/LORIA, Nancy (France) Master from UHP Nancy I (France)
My Research Main: Wireless Sensor Networks, Cyber-Physical
Systems, Real-Time Embedded Systems, Quality-of-Service, Performance Evaluation
Other: Security
3
Goals for Today3
Understand what is simulation and what is modelling
Some applications of simulation and modelling
What is the Life Cycle of the Modelling Process
4
Keywords4
System It is a collection of entities that act and interact
together toward the accomplishment of some logical end (computer, network, communication systems, etc.)
Simulation It is an experiment in a computer where the real
system is replaced by the execution of the program
It is a program that mimics (imitate) the behaviour of the real system
5
Keywords5
Model It is a simplification of the reality A (usually miniature) representation of
something; an example for imitation or emulation A model can be Analytical (Queuing Theory) or
by Simulation.
Performance Evaluation of a System means quantifying the service delivered by the System Experimental, Analytical, or by simulation
6
Example6
Real System (Motherboard)
Models of the System
7
Example7
Simulation Models of the System
8
Example8
Models of the System
9
Example9
Models of the System
10
Simulation
10
11
Why we need to Simulate?11
It may be too difficult, risky, or expensive to observe a real, operational system
Parts of the system may not be observable (e.g., internals of a silicon chip or biological system)
Uses of simulations Analyze systems (performance, behavior) before
they are built
Reduce the number of design errors
Optimize design to improve the behavior
Analyze operational systems
Create virtual environments for training,
entertainment
12
Applications of Simulation12
System Analysis
Telecommunication Networks (ATM, IP, TCP, UDP, WiFi …)
Transportation systems (Traffic, Urban planning, Metro
Planning, …)
Electronic systems (e.g., microelectronics, computer
systems)
Battlefield simulations (blue army vs. red army)
Ecological systems, Manufacturing systems, Logistics …
Virtual Environments
Physical phenomena (e.g. Trajectory of projectiles)
training and entertainment (e.g., military, medicine,
emergency planning, flight simulation)
13
A Few Example Applications
War gaming: test strategies; training
Flight Simulator Transportation systems: improved operations; urban planning
Computer communicationnetwork: protocol design
Parallel computer systems: developing scalable software
Games
14
Computer Simulation14
A Computer Simulation is a computer program
that attempts to simulate an abstract model of a
particular system.
that describes the behavior of a real (physical)
system and its evolution in time
How it works?
The behavior of the system is described by state
variables
The simulation program modifies the states
variables to emulate the evolution
15
Model Development Life Cycle
Define goals, objectives of study
Develop conceptual model
Develop specification of model
Develop computational model
Verify model
Validate model
Fundamentally an iterative
process
16
Model Development Life Cycle
Determine Goals and ObjectivesDetermine Goals and Objectives What do you what to do with the model
It may be an end in itself
More often, it is a means to an end
Goals may not be known when you start the project!
One often learns things along the way
Develop Conceptual ModelDevelop Conceptual Model An abstract representation of the system
What should be included in model? What can be left out?
What abstractions should be used? What is the level of details?
Appropriate choice depends on the purpose of the model
17
Model Development Life Cycle
Develop Specification ModelDevelop Specification Model A more detailed specification of the model including more
specifics Collect data to populate model
Example: Traffic: Road geometry, signal timing, expected traffic demand,
driver behavior Communication: network topology, message type, inter-arrival time
Empirical data or probability distributions often used Develop a Computational ModelDevelop a Computational Model
Executable simulation model Software approach
General purpose programming language Special purpose simulation language Simulation package
Other (non-functional) requirements Performance Interoperability with other models/tools/data
18
Model Development Life Cycle
VerificationVerification Did I Build the Model Right? النموذج أنجزت صحيح هل ؟بطريقة Does the computational model match the specification
model? Debugging: checking if the program contains any programming
errors. Verification is different from Validation: (see model validation)!
ValidationValidation Did I Build the Right Model? أنجزت الصحيح هل ؟النموذج Does the computational model match the actual (or
envisioned) system? Typically, the validation of a simulation model can be done by
comparing Measurements of actual system An analytic (mathematical) model of the system Another simulation model
By necessity, validation is always an incomplete activity! Often can only validate portions of the model If you can validate the simulation with 100% certainty, why build
the simulation?
19
Validation
Did I build the right model? Does the computational model match the
actual (or envisioned) system? Typically, compare against
Measurements of actual system An analytic (mathematical) model of the system Another simulation model
By necessity, always an incomplete activity! Often can only validate portions of the model If you can validate the simulation with 100%
certainty, why build the simulation?
20
Performance Evaluation
20
21
Performance Metrics21
The Performance Metric is a measurable quantity that precisely captures what we want to measure (response time, throughput, delay, etc.).
For example, In computer systems, we might evaluate The response time of a processor to execute a
given task. The execution time of two programs in a multi-
processor machine. In Network systems, we might evaluate
The (maximum/average) delay experienced by a voice packet to reach the destination
The throughput of the network The required bandwidth to avoid congestion
22
What does affect the performance?
22
The performance of a system is dramatically affected by the
Workload
The Workload: it characterises the quantity and the
nature of the system inputs
In the context of Web Servers, system inputs are http
requests (GET or POST requests). The workload
characterises
the intensity of the requests: how many requests are
received by the web server. High intensities
deteriorate the performance.
The nature of the requests: the request can be simple
GET request or a request that require the access of a
remote database. The performance will be different
for different request types.
Benchmarks: used to generate loads that is intended to
mimic a typical user behaviour.
23
Why to use models? Implementation on real systems is very complex and
costly, Experimentation on real systems may be dangerous
(e.g. chemical systems) If models adequately describes the reality,
experimenting with them can save money and time, and reduce the development complexity
When to use simulations? Analytic models may be very complex to evaluate, and
may lead to over implication of the real system Simulation can be a good alternative to evaluate the
system behavior very close to reality
Why using Models and Simulations?
24
State: A variable characterizing an attribute in the system the number of (messages/clients) in a queue waiting to be processed
Event: An occurrence at a point in time which may change the state of the system
Arrival/Departure of a message or start transmitting a message
Entity: An object that passes through the system Message (or packet) in a network, A job of a task in computer
Queue: A queue is buffer where entities are waiting for something to happen for any reason
Network: Queues are implemented in routers to handle messages Computer: Queues are implemented to handle jobs of tasks
Some Terminologies
25
Creating: Creating is causing an arrival of a new entity to the system at some point in time.
Scheduling: Scheduling is the act of
Random variable: A random variable is a quantity that is uncertain, such as inter-arrival time between two incoming flights or number of defective parts in a shipment
Random variate: A random variate is an artificially generated random variable
Distribution: A distribution is the mathematical law which governs the probabilistic features of a random variable.
Some Terminologies