1 Introduction to Simulation Chapters 24. Overview Simulation: Key Questions Introduction to Simulation Common Mistakes in Simulation Other Causes of.

Slides:



Advertisements
Similar presentations
McGraw-Hill/Irwin Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. A PowerPoint Presentation Package to Accompany Applied Statistics.
Advertisements

Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
Introduction To Simulation. 2 Overview Simulation: Key Questions Common Mistakes in Simulation Other Causes of Simulation Analysis Failure Checklist for.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 19 Scheduling IV.
Simulation Where real stuff starts. ToC 1.What, transience, stationarity 2.How, discrete event, recurrence 3.Accuracy of output 4.Monte Carlo 5.Random.
Introduction to Simulation
Discrete-Event Simulation: A First Course Steve Park and Larry Leemis College of William and Mary.
Simulation.
Lecture 9 Output Analysis for a Single Model. 2  Output analysis is the examination of data generated by a simulation.  Its purpose is to predict the.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 Introduction to Simulation Shiv Kalyanaraman Rensselaer Polytechnic Institute
1 Validation and Verification of Simulation Models.
EE694v-Verification-Lect5-1- Lecture 5 - Verification Tools Automation improves the efficiency and reliability of the verification process Some tools,
CS533 Modeling and Performance Evaluation of Network and Computer Systems Simulation (Chapters 24-25)
CS 450 Modeling and Simulation
1 CSc Senior Project Software Testing. 2 Preface “The amount of required study of testing techniques is trivial – a few hours over the course of.
IE 594 : Research Methodology – Discrete Event Simulation David S. Kim Spring 2009.
Analysis of Simulation Results Andy Wang CIS Computer Systems Performance Analysis.
Software Quality Chapter Software Quality  How can you tell if software has high quality?  How can we measure the quality of software?  How.
Wireless Networking and Systems CSE 590 ns2 tutorial.
1 Shawlands Academy Higher Computing Software Development Unit.
1 Validation & Verification Chapter VALIDATION & VERIFICATION Very Difficult Very Important Conceptually distinct, but performed simultaneously.
1 Performance Evaluation of Computer Networks: Part II Objectives r Simulation Modeling r Classification of Simulation Modeling r Discrete-Event Simulation.
Modeling and Performance Evaluation of Network and Computer Systems Introduction (Chapters 1 and 2) 10/4/2015H.Malekinezhad1.
1 Performance Evaluation of Computer Systems and Networks Introduction, Outlines, Class Policy Instructor: A. Ghasemi Many thanks to Dr. Behzad Akbari.
1 The Software Development Process  Systems analysis  Systems design  Implementation  Testing  Documentation  Evaluation  Maintenance.
Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able.
© 2003, Carla Ellis Simulation Techniques Overview Simulation environments emulation exec- driven sim trace- driven sim stochastic sim Workload parameters.
Analysis of Simulation Results Chapter 25. Overview  Analysis of Simulation Results  Model Verification Techniques  Model Validation Techniques  Transient.
Modeling and simulation of systems Model building Slovak University of Technology Faculty of Material Science and Technology in Trnava.
Network Simulator-2 Sandeep singla 1998A2A7540. NS-2 A discrete event simulator Focused on modeling network protocols –Wired, wireless –TCP,UDP,unicast,multicast.
1 Network Simulator Tutorial. 2 Network Simulation * Motivation: Learn fundamentals of evaluating network performance via simulation Overview: fundamentals.
Systems Life Cycle. Know the elements of the system that are created Understand the need for thorough testing Be able to describe the different tests.
ICOM 6115: Computer Systems Performance Measurement and Evaluation August 11, 2006.
Modeling and Simulation Discrete-Event Simulation
Discrete Event (time) Simulation. What is a simulation? “Simulation is the process of designing a model of a real system and conducting experiments with.
Prentice HallHigh Performance TCP/IP Networking, Hassan-Jain Chapter 4 TCP/IP Network Simulation.
ECE 466/658: Performance Evaluation and Simulation Introduction Instructor: Christos Panayiotou.
Simulation Techniques Overview Simulation environments emulation/ exec- driven event- driven sim trace- driven sim stochastic sim Workload parameters System.
1 Simulation H.Malekinezhad11/28/ Introduction (1 of 3) System to be characterized may not be available –During design or procurement stage Still.
The Software Development Process
1 Common Mistakes in Performance Evaluation (1) 1.No Goals  Goals  Techniques, Metrics, Workload 2.Biased Goals  (Ex) To show that OUR system is better.
12/7/2015© 2008 Raymond P. Jefferis III1 Simulation of Computer Systems.
NETE4631: Network Information System Capacity Planning (2) Suronapee Phoomvuthisarn, Ph.D. /
Introduction to Simulation Andy Wang CIS Computer Systems Performance Analysis.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
AMH001 (acmse03.ppt - 03/7/03) REMOTE++: A Script for Automatic Remote Distribution of Programs on Windows Computers Ashley Hopkins Department of Computer.
CSI 1340 Introduction to Computer Science II Chapter 1 Software Engineering Principles.
Chapter 1 Software Engineering Principles. Problem analysis Requirements elicitation Software specification High- and low-level design Implementation.
Software Quality Assurance and Testing Fazal Rehman Shamil.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
 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
Modelling & Simulation of Semiconductor Devices Lecture 1 & 2 Introduction to Modelling & Simulation.
1 Modeling and Performance Evaluation of Network and Computer Systems Simulation.
Common Mistakes in Performance Evaluation The Art of Computer Systems Performance Analysis By Raj Jain Adel Nadjaran Toosi.
OPERATING SYSTEMS CS 3502 Fall 2017
CPSC 531: System Modeling and Simulation
Prepared by Lloyd R. Jaisingh
Network Performance and Quality of Service
ADVANTAGES OF SIMULATION
Introduction to Simulation
Chapter 10 Verification and Validation of Simulation Models
Lecture 09:Software Testing
Computer Systems Performance Evaluation
MECH 3550 : Simulation & Visualization
Computer Systems Performance Evaluation
Presentation transcript:

1 Introduction to Simulation Chapters 24

Overview Simulation: Key Questions Introduction to Simulation Common Mistakes in Simulation Other Causes of Simulation Analysis Failure Checklist for Simulations Terminology Types of Models

Simulation: Key Questions What are the common mistakes in simulation and why most simulations fail? What language should be used for developing a simulation model? What are different types of simulations? How to schedule events in a simulation? How to verify and validate a model? How to determine that the simulation has reached a steady state? How long to run a simulation?

Simulation: Key Questions (Cont) How to generate uniform random numbers? How to verify that a given random number generator is good? How to select seeds for random number generators? How to generate random variables with a given distribution? What distributions should be used and when?

Introduction 5 System to be characterized may not be available During design or procurement stage Still want to predict performance Or, may have system but want to evaluate wide-range of workloads  Simulation The best advice to those about to embark on a very large simulation is often the same as Punch’s famous advice to those about to marry: ‘Don’t!’ – Bratley, Fox and Schrage (1986)

Simulation Failure simulation models often fail; that is, they produce no useful results or misleading results. This is either because the model developers are proficient in software development but lack statistical background or because they are proficient in statistical techniques but are not aware of good software development techniques

Common Mistakes in Simulation (1 of 4) 7 1. Inappropriate level of detail Level of detail often potentially unlimited But more detail requires more time to develop And often to run! Can introduce more bugs, making more inaccurate not less! Often, more detailed viewed as “better” but may not be the case More detail requires more knowledge of input parameters Getting input parameters wrong may lead to more inaccuracy (Ex: disk service times exponential vs. simulating sector and arm movement) Start with less detail, study sensitivities and introduce detail in high impact areas

Common Mistakes in Simulation (2 of 4) 8 2. Improper language Choice of language can have significant impact on time to develop Special-purpose languages can make implementation, verification and analysis easier C++Sim, JavaSim 3. Unverified models Simulations generally large computer programs Unless special steps taken, bugs or errors

Common Mistakes in Simulation (3 of 4) 9 4. Invalid models No errors, but does not represent real system Need to validate models by analytic, measurement or intuition 5. Improperly handled initial conditions Often, initial trajectory not representative of steady state Including can lead to inaccurate results Typically want to discard, but need method to do so effectively

Common Mistakes in Simulation (4 of 4) Too short simulation runs Attempt to save time Makes even more dependent upon initial conditions Correct length depends upon the accuracy desired (confidence intervals) 7. Poor random number generators “Home grown” are often not random enough Best to use well-known one 8. Improper Selection of Seeds:

More Causes of Failure 11 Large software Quotations above apply to software development projects, including simulations If large simulation efforts not managed properly, can fail 1. Inadequate time estimate Need time for validation and verification Time needed can often grow as more details added Any given program, when running, is obsolete. If a program is useful, it will have to be changed. Program complexity grows until it exceeds the capacity of the programmer who must maintain it. - Datamation 1968

More Causes of Failure No achievable goal Common example is “model X” But there are many levels of detail for X Goals: Specific, Measurable, Achievable, Repeatable, Through (SMART) The goals should be clearly written down and agreed to by the analysts and the end users of the results before beginning the model development Project without goals continues indefinitely

More Causes of Failure 3. Incomplete mix of essential skills A simulation project requires at least the following four areas of skills: (a) Project Leadership: The ability to motivate, lead, and manage the members of the simulation team. (b) Modeling and Statistics: The ability to identify the key characteristics of the system and model them at the required level of detail. (c) Programming: The ability to write a readable and verifiable computer program that implements the model correctly. (d) Knowledge of the Modeled System: The ability to understand the system, explain it to the modeling team, and interpret the modeling results in terms of their impact on the system

Other Causes of Simulation Analysis Failure 4. Inadequate Level of User Participation: You need to have meeting with the user to make sure the system is not changing. 5. Obsolete or Nonexistent Documentation: Do the documentation during the simulation 6. Inability to Manage the Development of a Large Complex Computer: Program Need software engineering tools to manage it 7. Mysterious Results: Most mysterious results are due to bugs in the simulation program, invalid model assumptions, or lack of understanding of the real system.

Simulation Checklist (1 of 2) 15

Simulation Checklist (2 of 2) 16

Terminology (1 of 7) 17 Introduce terms using an example of simulating CPU scheduling Study various scheduling techniques given job characteristics, ignoring disks, display… State variables Variables whose values define current state of system Saving can allow simulation to be stopped and restarted later by restoring all state variables Ex: In the CPU scheduling simulation, the state variable is the length of the job queue. Ex: in M/M/1 simulation, we will write down the queue length

Terminology (2 of 7) 18 Event A change in system state is called event Ex: In the CPU scheduling simulation, Three events: arrival of job, beginning of new execution, departure of job Continuous-time and discrete-time models If state defined at all times  continuous If state defined only at instants  discrete Ex: class that meets M-F 2-3 is discrete since not defined other times Jobs Time Students Time

Terminology (3 of 7) 19 Continuous-state and discrete-state models If uncountably infinite  continuous Ex: time spent by students on hw If countable  discrete Ex: jobs in CPU queue Note, continuous time does not necessarily imply continuous state and vice-versa All combinations possible Jobs Time Term

Types of Models (Cont)

Terminology (4 of 7) 21 Deterministic and probabilistic models If output predicted with certainty  deterministic If output different for different repetitions  probabilistic Ex: Simulation is usually probabilistic if you change the seed. It is better to repeat it. Otherwise it is deterministic Output Input Output Input (Deterministic)(Probabilistic) (vertical lines)

Terminology (5 of 7) 22 Static and dynamic models If Time is not a variable  static If state changes with time  dynamic Ex: CPU scheduler is dynamic, while matter-to-energy model E=mc 2 is static Linear and nonlinear models If Output is linear combination of input  linear Otherwise  nonlinear Output Input (Linear) Output Input (Non-Linear)

Terminology (6 of 7) 23 Open and closed models Input is external and independent  open Closed model has no external input Ex: if same jobs leave and re-enter queue then closed, while if new jobs enter system then open cpu open cpu closed

Terminology (7 of 7) 24 Stable and unstable Model output settles down and reaches steady state  stable Model output always changes  unstable How about Sinusoidal Model? Output Time (Unstable) Output Time (Stable)

Computer System Models Continuous time Discrete state Probabilistic Dynamic Nonlinear Open or closed Stable or unstable

HW

Selecting a Language for Simulation

Simulation Languages

General Purpose Language Analyst's familiarity Easy availability Quick startup: You know the programming language Time for routines for event handling, random number generation Other Issues: Efficiency, flexibility, and portability Recommendation: Learn at least one simulation language.

Extensions of a General Purpose Language

Simulation Packages Examples: Opnet, NS2 Input dialog Library of data structures, routines, and algorithms Big time savings Problem: Inflexible

Types of Simulation Languages

Discrete Event Simulation Example NS - (1 of 4) 33 NS-2, network simulator Government funded initially, Open source Wildly popular for IP network simulations

Discrete Event Simulation Example NS - (2 of 4) 34 (Event scheduler is core of simulator)

Discrete Event Simulation Example NS - (3 of 4) 35 # Open the NAM trace file set nf [open out.nam w] $ns namtrace-all $nf # Define a 'finish' procedure proc finish {} { global ns nf $ns flush-trace # Close the trace file close $nf #Execute NAM on file exec nam out.nam & exit 0 } # Setup a FTP set ftp [new Application/FTP] $ftp attach-agent $tcp $ftp set type_ FTP # Initial schedule events $ns at 0.1 "$cbr start" $ns at 1.0 "$ftp start" $ns at 4.0 "$ftp stop" $ns at 4.5 "$cbr stop" # Finish after 5 sec (sim time) $ns at 5.0 "finish" # Run the simulation $ns run

Discrete Event Simulation Example NS - (4 of 4) 36 Output in text file, can be processed with Unix command line tools (Objects and script can have custom output, too)