© 2003, Carla Ellis Simulation Techniques Overview Simulation environments emulation exec- driven sim trace- driven sim stochastic sim Workload parameters.

Slides:



Advertisements
Similar presentations
Idan Zaguri Ran Tayeb 2014 Parallel Random Number Generator.
Advertisements

Generating Random Numbers
Introduction To Simulation. 2 Overview Simulation: Key Questions Common Mistakes in Simulation Other Causes of Simulation Analysis Failure Checklist for.
Random Number Generation. Random Number Generators Without random numbers, we cannot do Stochastic Simulation Most computer languages have a subroutine,
Lab Assignment 1 COP 4600: Operating Systems Principles Dr. Sumi Helal Professor Computer & Information Science & Engineering Department University of.
Variance reduction techniques. 2 Introduction Simulation models should be coded such that they are efficient. Efficiency in terms of programming ensures.
G. Alonso, D. Kossmann Systems Group
 1  Outline  generation of random variates  convolution  composition  acceptance/rejection  generation of uniform(0, 1) random variates  linear.
Output analyses for single system
All Hands Meeting, 2006 Title: Grid Workflow Scheduling in WOSE (Workflow Optimisation Services for e- Science Applications) Authors: Yash Patel, Andrew.
Problems with parameterization (example:keeper usage): average duration: 1.27, min: 0.106, max: 6.46 possible outcome for keeper and crane queues? Assignment.
1 Statistical Inference H Plan: –Discuss statistical methods in simulations –Define concepts and terminology –Traditional approaches: u Hypothesis testing.
Output Data Analysis. How to analyze simulation data? simulation –computer based statistical sampling experiment –estimates are just particular realizations.
Random Number Generators. Why do we need random variables? random components in simulation → need for a method which generates numbers that are random.
Simulation Where real stuff starts. ToC 1.What, transience, stationarity 2.How, discrete event, recurrence 3.Accuracy of output 4.Monte Carlo 5.Random.
Output Analysis and Experimentation for Systems Simulation.
1 Random Number Generation H Plan: –Introduce basics of RN generation –Define concepts and terminology –Introduce RNG methods u Linear Congruential Generator.
Simulation Modeling and Analysis Session 12 Comparing Alternative System Designs.
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.
Random Number Generation
Variance Reduction Techniques
Lecture 10 Comparison and Evaluation of Alternative System Designs.
CSCE Monte Carlo Methods When you can’t do the math, simulate the process with random numbers Numerical integration to get areas/volumes Particle.
1 Simulation Modeling and Analysis Output Analysis.
Discrete Event Simulation
Random-Number Generation. 2 Properties of Random Numbers Random Number, R i, must be independently drawn from a uniform distribution with pdf: Two important.
Random Number Generation Pseudo-random number Generating Discrete R.V. Generating Continuous R.V.
ETM 607 – Random Number and Random Variates
Analysis of Simulation Results Andy Wang CIS Computer Systems Performance Analysis.
Simulation Output Analysis
Verification & Validation
Chapter 11 Output Analysis for a Single Model Banks, Carson, Nelson & Nicol Discrete-Event System Simulation.
Random-Number Generation Andy Wang CIS Computer Systems Performance Analysis.
CS433 Modeling and Simulation Lecture 15 Random Number Generator Dr. Anis Koubâa 24 May 2009 Al-Imam Mohammad Ibn Saud Islamic University College Computer.
Chapter 7 Random-Number Generation
Module 1: Statistical Issues in Micro simulation Paul Sousa.
Analysis of Simulation Results Chapter 25. Overview  Analysis of Simulation Results  Model Verification Techniques  Model Validation Techniques  Transient.
ICS 145B -- L. Bic1 Project: Main Memory Management Textbook: pages ICS 145B L. Bic.
Random Number Generators 1. Random number generation is a method of producing a sequence of numbers that lack any discernible pattern. Random Number Generators.
Monte Carlo Methods.
Monte Carlo Methods So far we have discussed Monte Carlo methods based on a uniform distribution of random numbers on the interval [0,1] p(x) = 1 0  x.
APPENDIX D R ANDOM N UMBER G ENERATION Organization of chapter in ISSO* – General description and linear congruential generators Criteria for “good” random.
Simulation Tutorial By Bing Wang Assistant professor, CSE Department, University of Connecticut Web site.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems with Multi-programming Chapter 4.
Simulation Techniques Overview Simulation environments emulation/ exec- driven event- driven sim trace- driven sim stochastic sim Workload parameters System.
Simulation & Confidence Intervals COMP5416 Advanced Network Technologies.
Network Simulation Motivation: r learn fundamentals of evaluating network performance via simulation Overview: r fundamentals of discrete event simulation.
1 OUTPUT ANALYSIS FOR SIMULATIONS. 2 Introduction Analysis of One System Terminating vs. Steady-State Simulations Analysis of Terminating Simulations.
Testing Random-Number Generators Andy Wang CIS Computer Systems Performance Analysis.
Parallel and Distributed Simulation Time Parallel Simulation.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
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.
0 Simulation Modeling and Analysis: Input Analysis 7 Random Numbers Ref: Law & Kelton, Chapter 7.
MONTE CARLO METHOD DISCRETE SIMULATION RANDOM NUMBER GENERATION Chapter 3 : Random Number Generation.
1.  How does the computer generate observations from various distributions specified after input analysis?  There are two main components to the generation.
© 2003, Carla Ellis Model Vague idea “groping around” experiences Hypothesis Initial observations Experiment Data, analysis, interpretation Results & final.
K. Salahpp.1 Chapter 9 Output Analysis for Single Systems.
Variance reduction techniques Mat Simulation
OPERATING SYSTEMS CS 3502 Fall 2017
Basic MC/Defn/Short Answer/Application Cumulative
CPSC 531: System Modeling and Simulation
Statistical Methods Carey Williamson Department of Computer Science
Random-Number Generation
Properties of Random Numbers
Carey Williamson Department of Computer Science University of Calgary
MECH 3550 : Simulation & Visualization
Where real stuff starts
Modeling and Simulation: Exploring Dynamic System Behaviour
Presentation transcript:

© 2003, Carla Ellis Simulation Techniques Overview Simulation environments emulation exec- driven sim trace- driven sim stochastic sim Workload parameters System Config parameters Factor levels Result Data Discrete events

© 2003, Carla Ellis The End Game: When to Stop t transient interval steady state final conditions a b

© 2003, Carla Ellis Issues If you stop at a – before the cleanup phase: –Must be careful in calculating metrics when some events are outstanding Example: scheduling simulation. Some jobs completed and some still in queue. Average service time must count just completed jobs. Average queue length must be over time not queuing events. If you stop at b – completion: –Not at steady state again Example: jobs are finishing with no new arrivals

© 2003, Carla Ellis Assuming you choose to stop at a – how to determine a? Simulation should be run long enough for the confidence interval for the mean response to narrow to desired width Variance of the sample mean of n independent observations uses variance of observations Stopping Criteria x ! z 1-   Var(x) Var(x) = Var(x) n

© 2003, Carla Ellis Correlated Observations Often the observations are not independent –Memory access time depends on cache state built by previous memory request –Waiting time depends on length of previous job Solutions –Independent replications of simulation experiment –Batch means –Regeneration

© 2003, Carla Ellis Replications m replications with different seed value each time, of size n+n 0 where n 0 is initial transient phase during which data is discarded. Confidence interval is inversely proportional to mn –Increase either m or n to get narrower C.I. –Page 431 shows how to calculate overall mean for all replications, Var(x), and C.I.

© 2003, Carla Ellis Batch means Subsamples – long simulation run of N + n 0 observations Divide N observations into m samples of n observations each Batch size n must be large enough so the batch means have little correlation Compute covariance of successive batch means x i and x i+1 with bigger n’s until it is small enough t n0n0 n n n C.I width again inversely proportional to mn

© 2003, Carla Ellis Regeneration Independent phases where the execution returns to an initial state –Flushed cache –Empty job queue Regeneration cycles may be of unequal length (complicates math – page 434) m cycles of n 1, n 2, …, n m sizes s.t. C.I. is narrow enough t Regeneration points Regeneration cycle

© 2003, Carla Ellis Structure of Discrete Event Simulation eventQ scheduler Event handlers State var results

© 2003, Carla Ellis Role of Random Values in Discrete Event Simulation eventQ scheduler Event handlers State var results e random parameters random values in initialization of state

© 2003, Carla Ellis Random Values Want random values with a specified distribution Step 1: produce uniformly distributed numbers between 0 and 1(random number generation) Step 2: apply transformation to produce values from desired distribution (random variate generation)

© 2003, Carla Ellis Random Number Generators x n = f ( x n-1, x n-2 ) where x 0 is seed Pseudo-random since, given the same seed, the sequence is repeatable and deterministic Cycle length – length of repeating sequence Example: x n = a x n-1 + b mod m seed cycle period

© 2003, Carla Ellis Desirable Properties Period should be large Should be efficiently computable Successive values should be independent and uniformly distributed Types discussed in Jain: –Linear congruential (LCG) –Tausworthe – long, based on exclusive-or –Extended Fibonacci Use “off the shelf” generator that has been tested

© 2003, Carla Ellis Using Random Number Generators Seed Selection – issue is critical if multistream simulation (need random numbers for more than one variable) Do not use zero and avoid even numbers as seeds Do not use one stream for two (or more) purposes s.t. u i is used for one variable and u i+1 for next (e.g. interarrival time and service time for next event – they would be correlated)

© 2003, Carla Ellis Use non-overlapping streams Using Random Number Generators seed 1 cycle period seed 2 cycle period

© 2003, Carla Ellis Random number stream does not have to be reinitialized for replications of simulation, can pick up where last one left off Do not use random seeds (e.g. time of day) –Can not be reproduced –Not possible to guarantee multiple streams do not overlap Using Random Number Generators

© 2003, Carla Ellis Potential Pitfalls Testing for randomness – a single test is not sufficient – chap 27, next lecture. Implementation matters – overflow and truncation can change the path of the sequence Bits of successive words are not guaranteed random (e.g. generating random memory addresses and then using page number field does not necessarily give you random pages)