CPSC 531: System Modeling and Simulation

Slides:



Advertisements
Similar presentations
Simulation - An Introduction Simulation:- The technique of imitating the behaviour of some situation or system (economic, military, mechanical, etc.) by.
Advertisements

Modeling and Simulation By Lecturer: Nada Ahmed. Introduction to simulation and Modeling.
Simulating Single server queuing models. Consider the following sequence of activities that each customer undergoes: 1.Customer arrives 2.Customer waits.
FIN 685: Risk Management Topic 5: Simulation Larry Schrenk, Instructor.
Introduction to Simulation
Discrete-Event Simulation: A First Course Steve Park and Larry Leemis College of William and Mary.
Steps of a sound simulation study
OS Fall ’ 02 Performance Evaluation Operating Systems Fall 2002.
Copyright © 2005 Department of Computer Science CPSC 641 Winter Simulation Methodology Plan: –Introduce basics of simulation modeling –Define terminology.
Simulation Waiting Line. 2 Introduction Definition (informal) A model is a simplified description of an entity (an object, a system of objects) such that.
OS Fall ’ 02 Performance Evaluation Operating Systems Fall 2002.
SIMULATION. Simulation Definition of Simulation Simulation Methodology Proposing a New Experiment Considerations When Using Computer Models Types of Simulations.
Lab 01 Fundamentals SE 405 Discrete Event Simulation
Feedback Control Systems (FCS)
Basic Simulation Modeling II
Monté Carlo Simulation MGS 3100 – Chapter 9. Simulation Defined A computer-based model used to run experiments on a real system.  Typically done on a.
Modeling and Simulation
1 Introduction to Simulation Chapters 24. Overview Simulation: Key Questions Introduction to Simulation Common Mistakes in Simulation Other Causes of.
Analysis of Simulation Results Andy Wang CIS Computer Systems Performance Analysis.
Discrete-Event System Simulation
(C) 2009 J. M. Garrido1 Object Oriented Simulation with Java.
Chapter 1 Introduction to Simulation
Modeling & Simulation: An Introduction Some slides in this presentation have been copyrighted to Dr. Amr Elmougy.
1 OM2, Supplementary Ch. D Simulation ©2010 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible.
Entities and Objects The major components in a model are entities, entity types are implemented as Java classes The active entities have a life of their.
1 Introduction to Software Engineering Lecture 1.
Modeling and Simulation Discrete-Event Simulation
McGraw-Hill/Irwin © 2006 The McGraw-Hill Companies, Inc., All Rights Reserved. 1.
Simulation Techniques Overview Simulation environments emulation/ exec- driven event- driven sim trace- driven sim stochastic sim Workload parameters System.
CPSC 441 Tutorial TA: Fang Wang. Simulation Methodology Plan: Introduce basics of simulation modeling Define terminology and methods used Introduce simulation.
Fall 2011 CSC 446/546 Part 1: Introduction to Simulation.
Object Oriented Discrete-Event Simulation CS4730 Fall 2010 Jose M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
McGraw-Hill/Irwin Copyright © 2009 by The McGraw-Hill Companies, Inc. All rights reserved.
Introduction to Simulation K.Sailaja Kumar 1 SYSTEM SIMULATION AND MODELLING Course Code: MCA 52 Faculty : Sailaja Kumar k.
Introduction to Simulation Andy Wang CIS Computer Systems Performance Analysis.
1 1 Slide Simulation Professor Ahmadi. 2 2 Slide Simulation Chapter Outline n Computer Simulation n Simulation Modeling n Random Variables and Pseudo-Random.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
(C) J. M. Garrido1 Objects in a Simulation Model There are several objects in a simulation model The activate objects are instances of the classes that.
Advantages of simulation 1. New policies, operating procedures, information flows and son on can be explored without disrupting ongoing operation of the.
Csci 418/618 Simulation Models Dr. Ken Nygard, IACC 262B
 Simulation enables the study of complex system.  Simulation is a good approach when analytic study of a system is not possible or very complex.  Informational,
Simulation. Types of simulation Discrete-event simulation – Used for modeling of a system as it evolves over time by a representation in which the state.
Building Valid, Credible & Appropriately Detailed Simulation Models
NETW 707: Modeling & Simulation Course Instructor: Tallal Elshabrawy Instructor Office: C3.321 Instructor Teaching.
Introduction To Modeling and Simulation 1. A simulation: A simulation is the imitation of the operation of real-world process or system over time. A Representation.
Modelling & Simulation of Semiconductor Devices Lecture 1 & 2 Introduction to Modelling & Simulation.
Texts: Gordon G N Deo J Banks et al.  Definition  Advantages and disadvantages  Suitability  Applications  Models  Components of system  Simple.
Traffic Simulation L2 – Introduction to simulation Ing. Ondřej Přibyl, Ph.D.
CPSC 531: System Modeling and Simulation
Chapter 12: Simulation and Modeling
Computer Simulation Henry C. Co Technology and Operations Management,
OPERATING SYSTEMS CS 3502 Fall 2017
Architecture Concept Documents
Modeling and Simulation (An Introduction)
ADVANTAGES OF SIMULATION
Chapter 1.
DSS & Warehousing Systems
CPSC 531: System Modeling and Simulation
Basic Simulation Modeling II
CPSC 531: System Modeling and Simulation
Simulation Carey Williamson Department of Computer Science
Prepared by Lee Revere and John Large
World-Views of Simulation
Computer Systems Performance Evaluation
Discrete-Event System Simulation
Computer Systems Performance Evaluation
Carey Williamson Department of Computer Science University of Calgary
MECH 3550 : Simulation & Visualization
Simulation Supplement B.
Presentation transcript:

CPSC 531: System Modeling and Simulation Carey Williamson Department of Computer Science University of Calgary Fall 2017

Recap: Performance Evaluation Performance Measurement Performance Modeling Analytic Modeling Simulation

Simulation Model Taxonomy (preview)

Terminology (1 of 2) A system is defined as a group of objects that interact with each other to accomplish some purpose A computer system: CPU, memory, disk, bus, NIC An automobile factory: Machines, components parts and workers operate jointly along assembly line A system is often affected by changes occurring outside the system: system environment Hair salon: arrival of customers Warehouse: arrival of shipments, fulfilling of orders Effect of supply on demand: relationship between factory output from supplier and consumption by customers

Terminology (2 of 2) Entity Attribute State Event An object of interest in the system: Machines in factory Attribute The property of an entity: speed, capacity, failure rate State A collection of variables that describe the system in any time: status of machine (busy, idle, down,…) Event An instantaneous occurrence that might change the state of the system: breakdown

Simulation Modeling Develop a simulation program that implements a computational model of the system of interest Run the simulation program and use the data collected to estimate the performance measures of interest (often involves the use of randomization) A system can be studied at an arbitrary level of detail Quote of the day: “The hardest part about simulation is deciding what NOT to model.” - Moe Lavigne, Stentor, Summer 1995

Advantages of Simulation New policies and procedures can be explored without disrupting the ongoing operation of the real system New designs can be tested without committing resources for their acquisition Time can be compressed or expanded to allow for a speed-up or slow-down of the phenomenon under study Insight can be obtained about the interactions of variables, and which ones have the most impact on system performance Can obtain answers to “What if…” questions

Disadvantages of Simulation Model building requires special training An important role for courses like CPSC 531!! Vendors of simulation software have been actively developing packages that contain models that only need input (templates), which simplifies things for users Simulation results can be difficult to interpret Need proper statistical interpretation for output analysis Simulation modeling and analysis can be time- consuming and expensive, both for the modeler, as well as in compute time (if not done judiciously)

When Simulation Is Not Appropriate When the problem can be solved by common sense When the problem can be solved analytically When it is easier to perform direct experiments When cost of simulations exceeds (expected) savings for the real system When system behavior is too complex (e.g., humans)

Common Mistakes in Simulation Poor (pseudo) random number generators Best to use well-known or well-understood generator Improper selection of seeds for PRNG Short periods; same seeds for all streams Inappropriate level of detail: More detail  more time  more bugs More parameters ≠ more accurate Improperly handled initial conditions (warmup) Improperly handled ending conditions (cooldown) Run-length too short to achieve steady-state Need proper output analysis, confidence intervals * Move to later slides

Types of Simulations Monte Carlo simulation Time-stepped simulation Trace-driven simulation Discrete-event simulation Continuous simulation

Simulation Model Taxonomy

Monte Carlo simulation (see Assignment 1) Simulation Examples Monte Carlo simulation (see Assignment 1) Estimating π Craps (dice game) Time-stepped simulation Mortgage scenarios Trace-driven simulation (see Assignment 2) Single-server queue (ssq1.c) Discrete-event simulation (see Assignments 3 and 4) Witchcraft hair salon

Monte Carlo Simulation Static simulation (no time dependency) To model probabilistic phenomenon Can be used for evaluating non-probabilistic expressions using probabilistic methods Can be used for estimating quantities that are “hard” to determine analytically or experimentally Named after Count Montgomery de Carlo, who was a famous Italian gambler and random-number generator (1792-1838). CPSC 531 - Ghaderi

Trace-Driven Simulation Trace = time-ordered record of events in system Trace-driven simulation = Trace input Often used in evaluating or tuning resource management algorithms (based on real workloads): Paging, cache analysis, CPU scheduling, deadlock prevention, dynamic storage allocation Example: Trace = start time + duration of processes Example: Trace = size in bytes of file written to disk Example: Trace = mobile device ID and call duration

Advantages of Trace-Driven Simulations Credibility Easy validation: compare simulation with measurement Accurate workload: models correlation and interference Fair comparison: better than random input Similarity to the actual implementation: trace-driven model is similar to the system can understand complexity of implementation

Disadvantages of Trace-Driven Simulations Complexity: more detailed Representativeness: workload changes with time, equipment Data Collection: few minutes fill up a disk Instrumentation: granularity; intrusiveness Single Point of Validation: one trace = one point Difficult to change workload

Discrete-Event Simulation A simulation model with three features: Stochastic: some variables in the simulation model are random Dynamic: system state evolves over time Discrete-Event: changes in system state occur at discrete time instances

Discrete and Continuous Systems A discrete system is one in which the system state changes only at a discrete set of points in time Example: A restaurant

Discrete and Continuous Systems A continuous system is one in which the system state changes continuously over time Example: Water level in Bow River (or Bearspaw dam)

Discrete-Event Simulation A simulation model in which system state evolves over a discrete sequence of events in time System state changes only when an event occurs System state does not change between the events Departure Arrival Arrival Arrival Restaurant Example

Continuous Simulation A simulation model in which system state evolves continuously over time Time is divided to small time slices System state changes in every time slice Dam Example

Characterizing a Simulation Model Deterministic or Stochastic Does the model contain stochastic components? Static or Dynamic Is time a significant variable? Continuous or Discrete Does the system state evolve continuously or only at discrete points in time?

Simulation Model Taxonomy

How to develop a simulation model: DES Model Development How to develop a simulation model: Determine the goals and objectives Build a conceptual model Convert into a specification model Convert into a computational model Verify the model Validate the model Typically an iterative process

Three Model Levels Conceptual Model Specification Model Very high level (perhaps schematic diagram) How comprehensive should the model be? What are the state variables? Which ones are dynamic, and which are most important? Specification Model On paper: entitites, interactions, requirements, rules, etc. May involve equations, pseudocode, etc. How will the model receive input? Computational Model A computer program General-purpose programming language or simulation language?

Simulation Software General purpose programming languages Flexible and familiar Well suited for learning DES principles and techniques E.g., C++, Java Simulation programming languages Good for building models quickly Provide built-in features (e.g., queue structures) Graphics and animation provided Domain specific Network protocol simulation: ns2, Opnet Electrical power simulation: ETAP Design and engineering: Ansys, Autodesk Process simulation: Simul8

Verification and Validation Computational model should be consistent with specification model Did we build the model right? Validation Computational model should be consistent with the system being analyzed Did we build the right model? Can an expert distinguish simulation output from system output?