Professional Documents
Culture Documents
Chapter 2 - Simulation....
Chapter 2 - Simulation....
Chapter 2 - Simulation....
2
Discrete Event Simulation (DES)
with an arrival
• Current length of the queue – to know where to store an
4
Time-Advance Mechanisms (…DES)
5
• More on next-event time advance
– Initialize simulation clock to 0
– Determine times of occurrence of future events – event list
– Clock advances to next (most imminent) event execution
Event execution may involve updating event list
6
• Next-event time advance for the single-server queue
ti = time of arrival of ith customer (t0 = 0)
Ai = ti – ti-1 = interarrival time between (i-1)st and ith customers (usually
assumed to be a random variable from some probability distribution)
Si = service-time requirement of ith customer (another random variable)
Di = delay in queue of ith customer
Ci = ti + Di + Si = time ith customer completes service and departs
ej = time of occurrence of the jth event (of any type), j = 1, 2, 3, …
– Possible trace of events (detailed narrative in text)
7
Terminologies in Simulation Modelling
8
Components and Organization of a DES
By: Muluken A. 9
• Each simulation model must be customized to target system
• Common components, general organization
• System state – variables to describe state
• Simulation clock – current value of simulated time
• Event list – times of future events (as needed)
• Statistical counters – to accumulate quantities for output
• Initialization routine – initialize model at time 0
• Timing routine – determine next event time, type; advance clock
• Event routines – carry out logic for each event type
• Library routines – utility routines to generate random variates, etc.
• Report generator – to summarize, report results at end
• Main program – ties routines together, executes them in right order
10
• More on Entities
• Objects that compose a simulation model
• Players that move around, change status etc
• Can have “fake” entities for modeling “tricks”
• Usually include customers, parts, messages, etc.
• Characterized by data values called attributes
• For each entity there’s a record (row) in a list, with the attributes
being the columns
11
More on Attributes
• Are set of properties of a particular entity (attributes individualize
entities)
• A group of entities may have same attribute but different values for
different entities, for example:
Time of arrival
Due date
Priority
Color
• Attribute value tied to a specific entity like local variables
• Arena keeps track of some attributes automatically,
• But you may need to define attributes of your own.
12
More on Variables (Global)
• Reflects a characteristic of the whole model, not of specific entities
• Used for many different kinds of things
Travel time between all station pairs
Number of parts in system
Simulation clock (built-in Arena variable)
• Name, value of which there’s only one copy for the whole model
• Entities can access, change variables
13
More on Resources
• What entities compete for
People
Equipment
Space
• Entity seizes a resource, uses it, releases it
• Think of a resource being assigned to an entity, rather than an entity
“belonging to” a resource
• A resource can have several units of capacity
Seats at a table in a restaurant
Identical ticketing agents at an airline counter
• Number of units of resource can be changed during the simulation
14
More on Queues
• Place for entities to wait when they can’t move on
• Have names, often tied to a corresponding resource
• Can have a finite capacity to model limited space means have to
model what to do if an entity shows already full
• Usually watch the length of a queue, waiting time in it.
15
More on Statistical accumulators
• Variables that “watch” what’s happening
• Depend on output performance measures desired
• “Passive” in model - don’t participate, just watch
• Many are automatic in Arena, but some you may have to set up and
maintain during the simulation
• At end of simulation, used to compute final output performance measures
16
Approaches to Modeling and Simulation
17
The Event Scheduling/Time Advance Algorithm
Simulation by Hand
Other Slide
18