Presentation is loading. Please wait.

Presentation is loading. Please wait.

WOOD 492 MODELLING FOR DECISION SUPPORT Lecture 25 Simulation.

Similar presentations


Presentation on theme: "WOOD 492 MODELLING FOR DECISION SUPPORT Lecture 25 Simulation."— Presentation transcript:

1 WOOD 492 MODELLING FOR DECISION SUPPORT Lecture 25 Simulation

2 Review Simulation: used to imitate the real system using computer software, helpful when system is too complex or has many stochastic elements Discrete event simulation: if the state of the system changes at random points in time as a result of various events Different probability distributions are used for different purposes Nov 5, 2012Wood 492 - Saba Vahid2

3 Distributions Various probability distributions are used for different random events Poisson : distribution of number of arrivals per unit of time Exponential : distribution of time between successive events (arrivals, serving customers,…) Uniform: for random number generation Normal : for some physical phenomenon's, normally used to represent the distributions of the means of observations from other distributions Binomial: coin flip … Nov 5, 2012Wood 492 - Saba Vahid3

4 Cumulative Distribution Function (CDF) Nov 5, 2012Wood 492 - Saba Vahid4 f(x) F(x) x x 1.0 t t Highlighted area: P(x<=t) P(x<=t)

5 Example 16 – A discrete event simulation Simulate a queuing system : –One server –Customers arrive according to a Poisson distribution (mean arrival rate λ = 3 per hour) –Service rate changes according to a Poisson distribution (mean service rate μ = 5 customers per hour) Nov 5, 2012Wood 492 - Saba Vahid5

6 Probability reminder Nov 5, 2012Wood 492 - Saba Vahid6

7 Example 16 – Queuing system State of the system at each time t – N(t) = number of customers in the queue at time t Random events in the simulation: –Arrival of customers (mean inter arrival times are 1/3 hour) –Serving the customers (mean service times are 1/5 hour) System transition formula: –Arrival: reset N(t) to N(t)+1 –Serve customer: reset N(t) to N(t)-1 How to change the simulation clock (2 ways) : 1.Fixed-time increment 2.Next-event increment Nov 5, 2012Wood 492 - Saba Vahid7

8 Fixed-time increment for Example 16 Nov 5, 2012Wood 492 - Saba Vahid8

9 Using random numbers to generate events To see if the events should occur or not, we use a random number generator to generate a uniform random number between [0,1] (e.g. in Excel there is a RAND() function that does this) If the random number is less than the calculated probability (in previous slide) we accept the event, if not we reject it. let’s assume we’ve generated a random number for the arrival of customers with Rand() function, random_A=0.1351 Random_A < 0.259 so we accept the arrival We must generate a new random number for each case, so let’s assume random_D=0.5622 Random_D >= 0.393 so we reject the departure N(1) = N(0)+ 1 (arrival) – 0 (departure) = 0+1=1 Nov 5, 2012Wood 492 - Saba Vahid9 Example 16


Download ppt "WOOD 492 MODELLING FOR DECISION SUPPORT Lecture 25 Simulation."

Similar presentations


Ads by Google