Download Basics of Simulation and more Exams Mathematical Modeling and Simulation in PDF only on Docsity!
CSE 411
Simulation & Modeling
Discrete Event Simulation
Discrete Event Simulation
- (^) State variables change instantaneously at different
point in time
- (^) Can change only at a countable number of points in time
- (^) Event occurs at those points
- (^) Event may change the state of a system
Single Server Queue
Estimate the average delay in queue or an arriving customer. Analytic Solution exists for simple ase, but in real life there can be ifferent complexity.
Single Server Queue: State
Variables
- (^) Status of Server
- (^) To determine upon a customer’s arrival, whether the customer can be served or must join in the queue
- (^) Number of customers waiting in the queue
- (^) To determine after completing service to a customer, whether the server become idle or start serving the first customer in the queue
- (^) Time of arrival of each person waiting in queue
- (^) To computer delay Dept of CSE, BUET 5
Simulation Clock
- (^) We need to-
- (^) Keep track of current value of simulated time
- (^) Mechanism to advance simulated time from one value to another
- (^) We maintain a simulation_clock
- (^) Unit is not explicitly stated, same as input parameters
- (^) No relationship between simulated time and time
needed to run the simulation on the computer
Time Advance Mechanisms
- (^) Next-Event Time Advance
- (^) Advance to the time of next event
- (^) Will be used throughout the course
- (^) Fixed-increment Time Advance
- (^) Simulation clock advanced in increments of exactly time units.
- (^) If one or more events were scheduled to have occurred during the interval, they are considered to have occurred at the end of the interval and the system state are updated accordingly.
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, which is
executed
- (^) Event execution may involve updating event list (Adding new event)
- (^) Continue until stopping rule is satisfied (must be
explicitly stated)
Next-Event Time Advance
- (^) Notations for Single Server Queue:
t
i
= time of arrival of i th customer ( t
0
A
i
= t
i
= interarrival time between ( i -1)st and i th customers (usually
assumed to be a random variable from some probability distribution F
A
S
i
= service-time requirement of i th customer (another random variable F
S
D
i
= delay in queue of i th customer
C
i
= t
i
+ D
i
+ S
i
= time i th customer completes service and departs
Components and Organization
of DES
- (^) Data Structures
- (^) System State – variables to describe state
- (^) Simulation Clock – current value of simulated time
- (^) Event List - List containing the next times of the future
events
- (^) Statistical Counters - Variables used for storing
statistical information about System performance
Components and Organization
of DES
- (^) Routines
- (^) 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
Reference
Simulation Modeling and Analysis by Averill M Law (Fourth
Edition) Chapter 1 (1.3, Appendix 1.A)
SIMULATION OF A SINGLE- SERVER QUEUEING SYSTEM
Known Input values:
(^) Arrival of customers – IID random variables (^) Service-time – IID random variables
Events :
(^) Arrival of a customer (^) Departure of a customer
SIMULATION OF A SINGLE-SERVER QUEUEING SYSTEM (^) Simulation starts from a “empty-and-idle” state (^) At t=0, waiting for the first customer starts (^) First customer arrives after the first interarrival time A (^) Simulation ends after a fixed number (n) of customers complete their delay in the queue (when n th customer enters into service) (^) Time to end is also a random variable (depends of interarrival and service-time random variables) (^) Other types of ending is also possible The Story
Different Random Variables
IID – Independent and Identically Distributed Random
Variables
(^) Output of two unbiased coin tosses (^) Events: {Head in first coin toss} and {Head in second coin toss}
Identically Distributed but not-independent
(^) From a bag containing two balls Black and White, (^) Events: {First ball drawn is Black} and {Second ball drawn is Black}
Can be of other types