lec 17a--discrete stochastic simulation (2)
TRANSCRIPT
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
1/57
Discrete/Stochastic Simulation
Using PROMODEL
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
2/57
Usages
Business Process Re-engineering
Manufacturing Process Design
Service Process Design
Operations
Supply chains As a planning tool
As an innovation and improvement tool
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
3/57
Applications of Discrete
Stochastic Simulation Resource management systems
Pollution management systems
Urban and regional planning Transportation systems
Health systems
Criminal justice systems
Industrial systems
Education systems
eCommerce systems
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
4/57
What Discrete Stochastic
Simulation isnt Stocks, states, rates, flows, information
Continuously changing variables
Causal loop diagramming
stock-and-flow diagramming
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
5/57
What Discrete Stochastic
Simulation is Probabilistic occurrences
Activity completions
Processes
Precedence relationships
Probabilistic routing
Events, Entities and Attributes
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
6/57
An exampleSouthwest Airlines
airline turn--ACTIVITIES Disembark passengers
Cabin cleanup
Embark passengers
Unload baggage
Load Baggage
Refuel Remove waste
Refurbish snacks and drinks
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
7/57
EVENTS for the airline gate turn
Arrival at gate
Beginning of unloading
Completion of passenger unloading Beginning of cleanup
Ending of cleanup
Beginning of passenger loading
Ending of passenger loading
Beginning of baggage unloading
Ending of baggage unloading
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
8/57
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
9/57
Events, Entities and Attributes
Entities may be permanent or temporary Customers, students, piece parts, messages, boxes,
items,--TEMPORARY
Universities, cities, companies, facilities, servers,
professors, service areas --PERMANENT Both entities and events possess ATTRIBUTES
Attributes of a server entitymean service time, std.dev. of service time, distribution type
attributes of an event--event type, no of entities assoc.with it
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
10/57
A typical service system scenario
In the early morning hours between 7 and 9a.m., arrivals to convenience stores arelarger than normal. If there are more than 6people waiting in line, new arrivals will
balk and go somewhere else. People arriveat the rate of 1 every second, but the time isexponentially distributed. Patrons shop fora time period that is uniformly distributedbetween 3 and 5 minutes.
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
11/57
Convenience Store Scenario,
continued It takes the checkout clerk an average of 43
sec to collect money from a customer and
provide them with a receipt, but this time isnormally distributed with a std dev. of 30
sec. . People will automatically enqueue
themselves in front of the checkout stand. The manager can hire a second clerk, who
is less well paid but also much slower
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
12/57
Convenience Store Scenario,
continued The store manager is interested in
the average waiting time of his patrons in the
queue the average number of customers that balked
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
13/57
With one store clerk:
average waiting time is 128 seconds
number of balked customers is 76 out of
1000 customers
Check out clerk is busy 86% of the time
checking out customers
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
14/57
With two store clerks:
average waiting time is 42 secs for the first
server
69 secs for the second
There are no balked customers
Servers are busy 70% and 40% of the time,
respectively
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
15/57
How does randomness come into
play? Probabilistic activity durations
Probabilistic routing decisions
Probabilistic arrivals
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
16/57
How is randomness created
within a digital computer? Monte Carlo--the computer generation of random
numbers
Sample the clock?--no--not replicable maintain a huge file of random numbers--no
Takes up too much space in primary memory
On secondary storage, its too slow
(when deciding to fetch from disk as opposed to primary
memory, the time required. is 500,000 times longer
Use an ALGORITHM? --YES, YES
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
17/57
Why use an algorithm?
The sequence it generates will be
deterministic
Doesnt take up much space in primarystorage
Takes up no space on secondary storage
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
18/57
An Algorithm for Generating
Random Numbers Must be fast (short and sweet)
Must be capable of generating numbers
that have all of the characteristics of
randomness, but in fact are deterministic
Multiplicative Congruence is one method
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
19/57
About Random Numbers
Uniform on the interval zero to one
They are completely independent and
therefore un-correlated
We represent them this way: U(0,1)
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
20/57
Multiplicative Congruence Algorithm
CI+1 = K*Ci
function random(float u, int I)
I = I * 1220703125;
if I
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
21/57
Notes
Generates a sequence on the entire interval of32-bit integers--0 to 2147483647
Maps these onto the real interval of 0 to 1
If the first multiplication causes integer overflow,the resultant number I will be negative--it is madepositive by adding the largest 32-bit integerrepresentable +1
The last multiplication is like dividing the numberby the largest integer possible
1/2147483647 = .4656613x10 to the minus 9
ou can eas y genera e ran om
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
22/57
ou can eas y genera e ran omnumbers in an EXCEL
spreadsheet using the functionRAND()
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
23/57
What about non-uniform random
numbers?Exponential
Normal
Gamma
Poisson
Lognormal
Rectangular
Triangular
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
24/57
ONE ANSWER: Use the inverse
transformation methodEvery non-uniform random variate has an
associated cumulative distribution
function F(x) whose values are containedwithin the interval 0 to 1 and whose values
are uniformly distributed over this interval
If x is a non uniform random variate, y = F(x) isuniformly distributed over the interval 0 to
1.
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
25/57
Strategy
If the inverse of the cumulative distribution
function F(x) exists so that x = F-1(y) can be
determined, then1) simply generate a random number
uniformly distributed on the interval 0 to 1
2) call this number y and apply the inversetransformation F-1(y) to obtain a random
number x with the appropriate distribution.
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
26/57
Exponential Random variates
1) generate a random number U using the
program given above
2)then apply EXPRND = -XMEAN * ALOG(U)
(This is simply using the inverse distribution
method)
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
27/57
When Analytic inverses of the
cumulative distribution function
are unavailableYou can use a table function
You can use specialized algorithms that have
been developed by academics over thirty-five years of cumulative research
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
28/57
Outputs
The animation reveals bottlenecks
We are also interested in
idleness, productivity, cycle time (time in the
system), wait time, blocked time
number of trips made in a given period of time,
system throughput within a given period oftime
We can get this from the statistical reports
provided after the simulation is finished
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
29/57
Discrete stochastic simulation
time advance Time is advanced from event to event.
The only time instants looked at are the event
times The events are stored chronologically in time in
an event file known as an event calendar
Corresponding to each event type is an event
subroutine
When an event occurs, its subroutine is called
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
30/57
Discrete-stochastic simulation
as A statistical experiment Running times must be long enough to
ensure sufficient samples are collected Several runs are often averaged together
The starting random number seeds are
changed and the model is rerun The basic idea is to get the variance to
converge to the actual real-world variance
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
31/57
Another scenario
A mufflers-shocks-brakes shop is turning
away business. It is considering hiring
another mechanic or adding another bay. Itcurrently has four bays.
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
32/57
Another scenario
A shipping company has just picked up
additional customers and needs to add
capacity. At its loading warehouse, it hasfour loading docks. It also has 10 trucks.
Trucks currently wait upon return for four
hours before they can go out on anothertrip. Should the company add docks,
remove trucks, or both.
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
33/57
Another scenario
A ski rental shop fits customers for boots
and then skis. It currently has four people
working in the boot area and four peopleworking in the ski area. Lines are very long
and waiting times unacceptable. Should
the shop hire more help or just shift someof its existing help from skis to boots or
vice versa.
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
34/57
GO BACK TO 7-11 STORE example
Consider a 7-11 store in which the 7-9 a.m.
period is of interest. Management is
considering hiring a second clerk. Patrons
arrive at the rate of one every 45 secs.
Arrivals are Exponentially distributed.Patrons shop for a period that is uniformly
distributed between 3 and 5 minutes. The
check out time for each customer is normalwith a mean of 43 secs and a std. dev. of 30
secs. Customers who encounter a queue
of six customers or more upon arrival will
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
35/57
What are the activities?
Arrivals
Shopping
Checkout
What about waiting in Queue?
This is not an activity
This is handled automatically by the
simulation
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
36/57
What units on time?
Secs or mins?
Lets go with SECONDS
We must be consistent!!!!
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
37/57
Must also identify
Locationspoints assoc with the starting
and stopping events of an activity
Path networkthe network the entitytravels
Resourcespermanent entities that act on
ordinary temporary entities Processesthe activities
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
38/57
PROMODEL
SELECT BACKGROUND--optional
BUILD-->locations
BUILD-->entities
BUILD-->PATH NETWORK
BUILD-->resources
BUILD-->processes and routing
BUILD-->arrivals
RUN IT
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
39/57
Locations
Places where an event of importance to the
model occurs
Like an arrivalA beginning of customer checkout
An ending of customer checkout
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
40/57
Entities
These are the temporary items that pass through
the model of the system
Chits Mail pieces
Piece parts
Students Cars
People
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
41/57
Path network
The network that will be followed by the
entities and/or the resources
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
42/57
Resources
Mobile permanent entities that can move
over a network
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
43/57
Processes
A process is required everywhere the entity
undergoes an operation
An exit process is always required
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
44/57
Routing
You must specify how the entities move
through the model
Usually you inform PROMODEL what pathnetwork to use
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
45/57
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
46/57
Now lets look at PROmodel
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
47/57
Exercise 1. (15 points) A local conveniencestore has a self-service island from which
it dispenses gasoline. Two lines of carsmay form on either side of the island. Theisland will accommodate no more than twocars being filled with gas on a single side.
There is space for no more than three carsin each of the two queues of cars waitingfor each of the two service areas.
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
48/57
Cars arrive at the rate of one every minute with a
distribution that is exponential. Service times are
normal with a mean of seven minutes and astandard deviation of two minutes. Cars will driveaway if more than six cars total are either waitingor in service (regardless of the line they are in).
Once cars have entered the stores gasolinefacility, they will en-queue themselves into theshortest queue. Formulate a model in BLOCKS todetermine how many cars are turned away in a
day. For BRANCH/ TRANSFERS, be sure to indicatethe type, such as UNCONDITIONALLY to block 12.Assuming the store is open 24 hours, setup themodel to determine how many cars are turnedaway in one 24-hour day.
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
49/57
Promodel
What do we need to know??
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
50/57
What the following are
Locations
Entities
Path networks
Resources
Processes
Arrivals
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
51/57
What has to be specified before
resources can be specified Path networks
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
52/57
In order to get more than one
arrival, the freq must be set to INFINITE
I d d bl h i f
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
53/57
In order to double the capacity of
the number of turning machines
and machining centers you
would
Go to locations and increase the capacity
from 1 to two for both of these locations
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
54/57
Failed Arrivals means
Arrivals that could not even get their foot in
the door, in this case because the pallet
was full
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
55/57
The important measures for this
model were Throughput for the product
Utilization of the resource
Utilization of the locations
Failed arrivals
Amount of blocked time there is
On the final you will be given a
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
56/57
On the final you will be given a
scenario like the ones above and
asked to determine
Locations
Entities
Path networksmay be asked to draw
these
Resources
Processes
Arrivals
-
7/30/2019 Lec 17A--Discrete Stochastic Simulation (2)
57/57
You will also need to know
what events and activities are
How random numbers are generated
How random variates (non-uniform) aregenerated
What is meant by MONTE CARLO