—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-1 Day 2 Section 3 - Introduction to Process Simulation –Modeling.

Slides:



Advertisements
Similar presentations
Exponential Distribution
Advertisements

Chapter 6 Continuous Random Variables and Probability Distributions
Many useful applications, especially in queueing systems, inventory management, and reliability analysis. A connection between discrete time Markov chains.
Exponential Distribution. = mean interval between consequent events = rate = mean number of counts in the unit interval > 0 X = distance between events.
Discrete Uniform Distribution
Channel Allocation Protocols. Dynamic Channel Allocation Parameters Station Model. –N independent stations, each acting as a Poisson Process for the purpose.
 1  Outline  performance measures for a single-server station  discrete-event simulation  hand simulation  process-oriented simulation approach.
Normal Distribution * Numerous continuous variables have distribution closely resemble the normal distribution. * The normal distribution can be used to.
Event-drive SimulationCS-2303, C-Term Project #3 – Event-driven Simulation CS-2303 System Programming Concepts (Slides include materials from The.
Queuing Analysis Based on noted from Appendix A of Stallings Operating System text 6/10/20151.
Chapter 22 Simulation with Process Model to accompany Operations Research: Applications and Algorithms 4th edition by Wayne L. Winston Copyright (c) 2004.
Engineering Probability and Statistics - SE-205 -Chap 4 By S. O. Duffuaa.
Probability Distributions
#11 QUEUEING THEORY Systems Fall 2000 Instructor: Peter M. Hahn
Introduction to the Continuous Distributions
Simscript II.5 Building simulation model with SIMSCRIPT II.5.
—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 4-1 Day 2 Section 3 - Introduction to Process Simulation –Modeling.
7/3/2015© 2007 Raymond P. Jefferis III1 Queuing Systems.
Lecture 4 Mathematical and Statistical Models in Simulation.
Class notes for ISE 201 San Jose State University
Probability Distribution
Chapter 5 Several Discrete Distributions General Objectives: Discrete random variables are used in many practical applications. These random variables.
Slide - 1 Dr Terry Hinton 6/9/05UniS - Based on Slides by Micro Analysis & Design An example of a Simulation Simulation of a bank: Three tasks or processes:
A Review of Probability Models
1 Exponential Distribution & Poisson Process Memorylessness & other exponential distribution properties; Poisson process and compound P.P.’s.
1 Performance Evaluation of Computer Systems By Behzad Akbari Tarbiat Modares University Spring 2009 Introduction to Probabilities: Discrete Random Variables.
(C) 2009 J. M. Garrido1 Object Oriented Simulation with Java.
Simulation Examples ~ By Hand ~ Using Excel
1 Performance Evaluation of Computer Networks: Part II Objectives r Simulation Modeling r Classification of Simulation Modeling r Discrete-Event Simulation.
The Poisson Process. A stochastic process { N ( t ), t ≥ 0} is said to be a counting process if N ( t ) represents the total number of “events” that occur.
Exponential and Chi-Square Random Variables
Nachos Phase 1 Code -Hints and Comments
CPSC 531: Probability Review1 CPSC 531:Distributions Instructor: Anirban Mahanti Office: ICT Class Location: TRB 101.
Chapter 5 Statistical Models in Simulation
Commonly Used Distributions Andy Wang CIS Computer Systems Performance Analysis.
5-1 Business Statistics: A Decision-Making Approach 8 th Edition Chapter 5 Discrete Probability Distributions.
 A probability function is a function which assigns probabilities to the values of a random variable.  Individual probability values may be denoted by.
Discrete Distributions The values generated for a random variable must be from a finite distinct set of individual values. For example, based on past observations,
Structure of a Waiting Line System Queuing theory is the study of waiting lines Four characteristics of a queuing system: –The manner in which customers.
Stochastic Models Lecture 2 Poisson Processes
Random Variables and Probability Models
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.
Data Structures Using C++ 2E Chapter 8 Queues. Data Structures Using C++ 2E2 Objectives Learn about queues Examine various queue operations Learn how.
STA347 - week 31 Random Variables Example: We roll a fair die 6 times. Suppose we are interested in the number of 5’s in the 6 rolls. Let X = number of.
Simulation Using computers to simulate real- world observations.
NETW 707 Modeling and Simulation Amr El Mougy Maggie Mashaly.
Chapter 01 Probability and Stochastic Processes References: Wolff, Stochastic Modeling and the Theory of Queues, Chapter 1 Altiok, Performance Analysis.
Reid & Sanders, Operations Management © Wiley 2002 Simulation Analysis D SUPPLEMENT.
—————————— CACI Products Company - ——————————————————— COMNET III —————————————— 1-1 Day 1 - COMNET Program Operation, Network Topology.
Exam 2: Rules Section 2.1 Bring a cheat sheet. One page 2 sides. Bring a calculator. Bring your book to use the tables in the back.
Some Common Discrete Random Variables. Binomial Random Variables.
CS3502: Data and Computer Networks Local Area Networks - 1 introduction and early broadcast protocols.
Random Variables Example:
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
 Recall your experience when you take an elevator.  Think about usually how long it takes for the elevator to arrive.  Most likely, the experience.
 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,
Computer Performance Modeling Dirk Grunwald Prelude to Jain, Chapter 12 Laws of Large Numbers and The normal distribution.
Ch 1: Simulation of Computer Networks. 1.1 Computer Networks and the Layering Concept Layering Concept Service Interface Protocol.
©The McGraw-Hill Companies, Inc. 2008McGraw-Hill/Irwin Continuous Probability Distributions Chapter 7.
OPERATING SYSTEMS CS 3502 Fall 2017
Known Probability Distributions
Probability Distributions: a review
Engineering Probability and Statistics - SE-205 -Chap 4
Random variables (r.v.) Random variable
Binomial and Geometric Random Variables
STATISTICS AND PROBABILITY IN CIVIL ENGINEERING
Random Variables and Probability Models
Process Description and Control
III. More Discrete Probability Distributions
Presentation transcript:

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-1 Day 2 Section 3 - Introduction to Process Simulation –Modeling the Passage of Time –Processes –Randomness –Exercise 3 Section 4 - Process Simulation II –Time –Resources –Implementation of the Process Approach –Exercise 4 

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-2 Section 3 - Introduction to Process Simulation Part 1 - Modeling the Passage of Time

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-3 Modeling the Passage of Time Suppose we have a telephone system consisting of two incoming lines. Calls arrive at a certain rate. If a line is free, the call is answered and the line is tied up for a certain amount of time, then released. If both lines are busy, the caller hangs up, and the call is lost. We want to simulate the operation of the system and keep track of the number of lost calls. –How do you model this? –How do you write a SIMSCRIPT II.5 program to simulate it? –How does SIMSCRIPT II.5 take care of the details?

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-4 Modeling the Passage of Time (continued) Activity Start Call End Call Process Start Call End Call Start Call End Call Events Another Call Line 1 Line 2

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-5 Modeling the Passage of Time (continued) An event is instantaneous –Something of importance happens at an event (change of state) Global variable changes Entity is changed, created, filed, removed or destroyed Another process or event is scheduled Time passes by doing nothing until another event occurs. This passage of time is a called an activity A process is a sequence of events and activities that affect an entity as it travels through our simulated system.

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-6 Next-event Time Advance You don't move the clock ahead a certain amount then ask what has happened (fixed-increment time advance). You ask when the next process is to occur, set the clock to that time, then execute the process. The variable, time.v, is the clock

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-7 Section 3 - Introduction to Process Simulation Part 2 - Processes

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-8 How do we Model a Process? For a single instance of the process write down the steps in order of occurrence –Instantaneous events –Activities that take time Activate it every time we want a process to occur SIMSCRIPT II.5 will take care of the rest

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-9 How Does SIMSCRIPT II.5 Handle the Details? There are four key elements: –The process notice –The event set –The timing routine –The process routine

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-10 The Process Notice A special type of temporary entity containing data needed to execute one copy or instance of the process; nine SIMSCRIPT II.5 attributes Preamble Processes include INCOMING.CALL End ''Preamble Outside the preamble Activate an INCOMING.CALL at 8 Creates the process notice Sets time.a to 8 Files the process notice in the event set

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-11 The Event Set A set ranked by low time.a Contains all process notices in order of occurrence It is called ev.s Processes begun by Start Simulation statement –In main routine –Must be one process in the event set before simulation starts

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-12 The Timing Routine Any Process or Event Notices in the Event Set Select Process or Event Notice with Earliest Execution Time Update Simulation Clock to Time of Process or Event Determine type of Process or Event Remove Process or Event Notice from the Event Set Execute the Process or Event Routine Start Simulation Return YES NO

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-13 Process Routine Process INCOMING.CALL If NUMBER.BUSY < 2 Add 1 to NUMBER.BUSY Wait uniform.f (6.0,10.0,2) minutes Subtract 1 from NUMBER.BUSY Else Add 1 to LOST.CALLS Endif ''NUMBER.BUSY < 2 End ''INCOMING.CALL

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-14 The Timing Routine (continued) Wait statement transfers control back to time.r Time.r –Changes time.a to the current time plus waiting time. –Records the number of the line last executed. –Files the process notice back in the event set. –Gets the next process notice. When the waiting period is up, that is, this process notice is first in ev.s, time.r passes control back to the process routine at the line after the Wait statement.

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-15 Section 3 - Introduction to Process Simulation Part 3 - Randomness

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-16 Probability Distributions Simscript II.5 provides a number of built-in probability distributions: random.ferlang.f randi.fnormal.f uniform.flog.normal.f poisson.fWeibull.f exponential.fbinomial.f gamma.ftriangular.f beta.f Let.PROB = distrib(parameters, random number stream) Let.PROB = uniform.f(1.0,5.0,2) (Check the Reference Manual - Section 1.8, Table 6, System Functions, page 30 – In the online help, pick SIMSCRIPT II.5 - System functions.).

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-17 Poisson Poisson process –Customers arrive one at a time (no batches) –The number of customers arriving in the time interval from T to T+S is independent of the number that arrived in the earlier time interval 0 to T. (This property would be violated if the number arriving from 0 to T caused some of the arrivals arriving from T to T+S to balk.) –The distribution of the number of arrivals between T & T+S is independent of T. (If we restrict our analysis to a short period - e.g., 1-hour peak traffic - assumption okay.) Possible applications –Message generation - number of message arrivals in a given interval of time

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-18 Exponential Extensively used in queuing models Memoryless property –Remembering the time since the last event does not help in predicting the time until the next event Possible applications –Interarrival times for a Poisson process are exponentially distributed. –Message length –Reliability models (time between failure) –Service time of devices

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-19 Uniform Commonly used if a random variable has bounds and no other information is available –Distance between source and destinations of messages on a network –Seek time on a disk

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-20 Uniform (Integer) Discrete version of uniform Possible applications –I/O device number for next I/O –Source & destination node for next packet on network –Track numbers for seeks on a disk

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-21 Geometric The distribution of the number of trials up to and including the first success in a sequence of Bernoulli trials –Bernoulli variate takes on values of failure or success, such as 0 or 1. Discrete equivalent of exponential Possible applications –Number of local queries to database between successive accesses to remote database –Number of packets successfully transmitted between retransmissions –Number of successive error-free bits between in-error bits in a packet on a noisy links –Batch sizes where batches arrive according to a Poisson distribution

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-22 Normal Used whenever randomness caused by several independent sources acting additively –Errors in measurement –Errors in modeling to account for a number of factors omitted from the model –Sample means of a large number of independent observations from a distribution

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-23 Beta Distribution Very flexible distribution –Shape parameter A = B = 1 => uniform –If shape parameters are equal and greater than 1, the Beta approaches a normal distribution without infinite tails Possible applications Often used where a normal distribution expected because it lacks infinite tails –Time to complete a task

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-24 Triangular Distribution Interview “those in the know” –minimum –maximum –“typical value” Possible applications –Often used as a first approximation in the absence of data

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-25 Exercise 3 The Telephone Model C:\Program Files\Simscript3\models\Telphn1

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-26 The Telephone Model Introduction to Process Simulation –Process generator –What happens to entities when process is activated –How are entities disposed? Try adding code to –Run the simulation as long as the user wants [Hint - time.v is the simulation clock] –Calculate the average processing time for each telephone call

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— Preamble 2 3 '' A simple telephone system model - CACI Products Company 4 '' files: TELPHN1.SRC 5 6 Normally mode is undefined 7 8 Processes include 9 GENERATOR Every INCOMING.CALL has 12 a CALL.ID Define CALL.ID as an integer variable Define NUMBER.BUSY and 17 LOST.CALLS 18 as integer variables End ''Preamble 1 Main 2 Activate a GENERATOR now 3 4 Start simulation 5 6 Print 1 line with LOST.CALLS thus 15 phone calls were made and ** were lost due to busy lines

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— Process GENERATOR 2 3 Define.I as an integer variable 4 5 For.I = 1 to 15 6 Do 7 8 Activate a INCOMING.CALL now 9 Let CALL.ID(INCOMING.CALL) =.I Wait uniform.f (2.0, 6.0, 1) minutes Loop ''I = 1 to End ''GENERATOR 1 Process INCOMING.CALL 2 3 If NUMBER.BUSY < Add 1 to NUMBER.BUSY 6 Wait uniform.f(6.0, 10.0, 2) minutes 8 9 Read as / using unit End ''Main

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— Subtract 1 from NUMBER.BUSY 8 9 Else Add 1 to LOST.CALLS Endif ''NUMBER.BUSY < End ''INCOMING.CALL

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-30 At 0. minutes, the GENERATOR is at line -1 prior to execution. At 0. minutes, call 1 is at line -1. Number busy = 0 and Lost calls = 0. At 5.7 minutes, the GENERATOR completes line 8. At 5.7 minutes, call 2 is at line -1. Number busy = 1 and Lost calls = 0. At 6.7 minutes, call 1 completes line 6. Number busy = 2 and Lost calls = 0 At 8.4 minutes, the GENERATOR completes line 8. At 8.4 minutes, call 3 is at line -1. Number busy = 1 and Lost calls = 0. At 11.4 minutes, the GENERATOR completes line 8. At 11.4 minutes, call 4 is at line -1. Number busy = 2 and Lost calls = 0. At 12.4 minutes, call 2 completes line 6. Number busy = 2 and Lost calls = 1 At 17.3 minutes, the GENERATOR completes line 8. At 17.3 minutes, call 5 is at line -1. Number busy = 1 and Lost calls = 1. At 17.9 minutes, call 3 completes line 6. Number busy = 2 and Lost calls = 1 At 20.3 minutes, the GENERATOR completes line 8. At 20.3 minutes, call 6 is at line -1. Number busy = 1 and Lost calls = 1. At 23.6 minutes, call 5 completes line 6. Number busy = 2 and Lost calls = 1 At 25.7 minutes, the GENERATOR completes line 8. At 25.7 minutes, call 7 is at line -1. Number busy = 1 and Lost calls = 1. At 27.4 minutes, call 6 completes line 6. Number busy = 2 and Lost calls = 1 At 30.3 minutes, the GENERATOR completes line 8. At 30.3 minutes, call 8 is at line -1. Number busy = 1 and Lost calls = 1. At 33.4 minutes, call 7 completes line 6. Number busy = 2 and Lost calls = 1

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-31 At 35.6 minutes, the GENERATOR completes line 8. At 35.6 minutes, call 9 is at line -1. Number busy = 1 and Lost calls = 1. At 39.3 minutes, the GENERATOR completes line 8. At 39.3 minutes, call 10 is at line -1. Number busy = 2 and Lost calls = 1. At 39.6 minutes, call 8 completes line 6. Number busy = 2 and Lost calls = 2 At 42.2 minutes, the GENERATOR completes line 8. At 42.2 minutes, call 11 is at line -1. Number busy = 1 and Lost calls = 2. At 45.3 minutes, call 9 completes line 6. Number busy = 2 and Lost calls = 2 At 46.0 minutes, the GENERATOR completes line 8. At 46.0 minutes, call 12 is at line -1. Number busy = 1 and Lost calls = 2. At 49.0 minutes, the GENERATOR completes line 8. At 49.0 minutes, call 13 is at line -1. Number busy = 2 and Lost calls = 2. At 50.6 minutes, call 11 completes line 6. Number busy = 2 and Lost calls = 3 At 53.9 minutes, call 12 completes line 6. Number busy = 1 and Lost calls = 3 At 54.3 minutes, the GENERATOR completes line 8. At 54.3 minutes, call 14 is at line -1. Number busy = 0 and Lost calls = 3. At 59.5 minutes, the GENERATOR completes line 8. At 59.5 minutes, call 15 is at line -1. Number busy = 1 and Lost calls = 3. At 62.4 minutes, call 14 completes line 6. Number busy = 2 and Lost calls = 3 At 65.0 minutes, the GENERATOR completes line 8. At 68.0 minutes, call 15 completes line 6. Number busy = 1 and Lost calls = 3 15 phone calls were made and 3 were lost due to busy lines