Discrete-Event Simulation:
Contents
Objects of the system: entities, classes, attributes and sets Operation of entities: event, activity and process Activity cycle diagram
Objects of the system: entities, classes, attributes and sets
DES is most prevalent type of simulation In DES, a system is the main object System any object which has some action to perform and is dependent on a number of objects Entity is an object which make up a system, and is the object of interest Example: if college is considered as a system, then classrooms, students, laboratories etc are its entities Attributes are properties of the system or entity, they have unique values with in the system or for each entity
Every system has a state
Set of data stored in variable Captures salient features of a system Allows to describe state evolution of system It can be defined in various ways depending on system to be modeled and need in performance analysis
Example for a single server system
S1- number of units in the system S2- customers in queue and their identity
Examples- single machine system with out failure It is FIFO buffer The state S(t) is the number of jobs in the system at time t There are two events
Job arrival event Service completion event
At time t, if S(t) is n, then S(t)=n+1 if job arrival event occurs and n-1 if job completion event occur
Example 2- machine with failure
The state of the system is represented as S(t)=(N(t), V(t))
N(t) is the number of jobs in the system V(t) is the status of the machine ( 0 idle, 1 busy and 2 failed)
The events are
Job arrival Job completion Machine failed Machine repaired
State transition will be job arrival ( n, v) service completion failure arrival repair completion
(n+1,v) ( n, 1) (n,1) (n,2)
(0,0) (n 1,1)
If n=1 If n>1
(n,2) (n,1)
Operation of entities: event, activity and process
Event is a data structure that contains a field containing its time of occurrence and other fields
Occurrence of an event- is execution of a procedure at the event occurrence time When each event occurs, state vector will be either incremented or decremented
Evolution of simulation is governed by clock and event list In the event list, events are linked to each other according to their occurrence Execution of an event may schedule another event Between events, simulation state is assumed constant
Activity is a function to be performed by an entity
Are described with preconditions and actions Condition must be fulfilled for an activitys operation to be scheduled and performed
Process is the sequence of operations that an entity passes through during its life in a system
Are sequence of events or activities Describes the behavior of an entities that flow through a system Useful for description of systems having resource contention Are represented by control flow diagrams which show the sequence of processes that each entity passes through
DES algorithm
1 2 3 4 Set simulation clock to zero Generate one or more events and schedule them If event list is empty stop, else find the next event Advance the clock to the time of the next event and execute it 5 Loop back to step 3
8 1 7 6 8 7 8 6 5 4
3
6 4 5 2 6 4 7 7 6
Monte Carlo Sampling and histories
Monte Carlo simulations involve random values Generated using random number generators (RNG)
RNG are used to schedule random events Event time = Random number generated from sample of inter event time + current clock time
DES performance evaluation
Is a statistical experiment Performance measures are estimated from a set of histories Steps in performance estimation Multiple simulations are run using random numbers One or more performance measures are computed from each run The performance values are taken as samples and statistical computations are performed
Design methods
Activity cycle diagram Event oriented graph Petri-Net approach Control graph
Activity cycle diagram
Is a graphical representation technique used to describe activity and process interaction models It models interaction of entities It describes the progression of activity and queue states that entities pass through In an activity cycle diagram entities come together to engage in activities and when the activity is complete the entities move on to reside in a queue until required for another (or repeat of the same) activity. Alternating sequence of activities and queues. Only two symbols are required to be represented in the model : a queue and an activity, usually represented by a circle and rectangle respectively.
Symbols used
Two types of entities may exist
Entities which enter and leave the system
World queue special queue
Entities which totally reside inside the system
Dummy queues have to be inserted if activities continue without any delay All activity cycles have to be closed loop
Steps in developing ACD
Specify the model domain. List all entities and their key attributes For each entity define its individual closed cycle of activity - queue - activity Merge the individual activity cycles Verify the logic of the diagram and amend as necessary.
Specify the model domain.
Specify the objective of the model Specify the main activities in the model Example : single server system
Customer arrives and waits until server is idle, then grabs the server and gets service. Finally leaves the system Server takes in a customer and then serve it and come back to idle step
List all entities and their key attributes
Entities are
Customer Server
Attributes
Customer arrival time and service time Server idle or busy
For each entity define its individual closed cycle of activity - queue - activity
Customer activity cycle
Customer Arrival World queue Wait for server
Get service
Server activity cycle
Serve customer idle
Merge the individual activity cycles
Identify common activities Serve customer and get service activities are the same Customer
Arrival
World queue
Get service
Wait for server
idle
Some issues in ACD
Arrival activities
Is a special activity World queue contains infinite entities No control over arrival time Artificial entity called gate which interact with arrival activity
World queue Arrival
Hold gate
Some issues cont
Time limited cycles
Some activities may be multi period controlled Extend the principle of arrival activity Example traffic light 3 period time limited
Green - 5 minute, Amber -30 seconds and Red 5.5 minutes
Resource limitation
some entities may have limited availability
Example : if queue size is limited
Extended conventions of ACD symbols
Queue
Include
Name- is name of queue for easy reference Number is id for easy reference Capacity is maximum queue capacity
Activity
Source and destination queue numbers Activity name, activity number Other parameters
Simulation program generator
Main use of ACD is as front end in simulation program generator Simulation program generator is a program that generates high level language codes from ACD or other graphical inputs CAPS/ECSL, DRAFT and GASSONL