2. CONTENTS
• Concepts in Discrete-Event Simulation
• The Event-Scheduling / Time-Advance Algorithm
• World Views
• Manual simulation Using Event Scheduling
• List processing
• Simulation in Java
2
3. CONCEPTS IN DISCRETE-EVENT
SIMULATION
• System: A collection of entities that interact together over time
• Model: A abstract representation of a system
• System State: A collection of variables that contain all the
information necessary to describe the system at any time
• Entity: Any object or component in the system that requires
explicit representation in the model
• Attributes: the properties of a given entity
3
4. • List: A collection of associated entities , ordered in some
logical fashion
• Event: An instantaneous occurrence that changes the state
of a system
• Event Notice: A record of an event to occur at the current
and some future time , along with any associated data
necessary to execute an event
4
5. • Event List: A list of event notices for future events ordered
by time of occurrence also known as FUTURE EVENT
LIST(FEL)
• Activity: A duration of time of specified length
• Delay: A duration of time of unspecified indefinite length
• Clock: A variable representing simulated time
5
6. THE EVENT-SCHEDULING / TIME-ADVANCE
ALGORITHM
• The mechanism for advancing simulation time and guaranteeing that
all events occur in correct chronological order is based on the FEL
• The FEL is ordered by event time, in chronological order ,
t < t1 ≤ t2 ≤ t3 ≤ ….. tn
where t is the value of CLOCK , the current value of simulated time.
t1 is called the imminent event , i.e., the next event will occur.
6
7. • After the system snapshot at simulation time,
CLOCK_t is updated , the CLOCK is advanced to simulation time
CLOCK t1 and the imminent event notice is removed from the FEL
and the event is executed.
• Sequence of actions which a simulator must perform to advance the
clock system snapshot is called the event scheduling/time advance
algorithm
7
9. ALGORITHM
1. Remove the event notice for the imminent event
2. Advance the CLOCK to imminent event time
3. Execute imminent event: update system state , change entity ,
attributes and set membership as needed.
4. Generate future events and place their event notices ranked
by event time
5. Update cumulative statistics and counters
9
12. WORLD VIEWS
• Orientation for developing a model.
the most prevalent world views are ,
• Event Scheduling world view
• Process interaction world view
• Activity scanning world view
12
13. ACTIVITY SCANNING WORLD VIEW
• 3 phase approach , where events are considered to be activity duration-zero time
units which are categorized into 2 type of activities namely activities of type B & C
• B activities – bound to occur: all primary
• C activities: conditional , upon certain conditions being true
• 3 phases are
• Phase A
• Phase B
• Phase C
13
14. MANUAL SIMULATION HANDLING USING
EVENT SCHEDULING
• Eg: single channel queue
• System state: LQ(t) , LS(t)
• Entities: server and the customers
• Events : Arrival (A) , Departure (D) , Stopping event(S)
• Event notices: (A,i) , (D,t) , (S , t)
• Activities: IAT , Service time
• Delay : customer spent in the waiting line
14
17. LIST PROCESSING
• Lists: Basic properties and operations
• Using Arrays for list processing
• Using dynamic Allocations and Linked Lists
17
18. SIMULATION IN JAVA
• A discrete event simulation model written in java contains
the components like System state, entities & attributes,
sets, events, activities, and delays.
• To facilitate the development and debugging , it is best to
organize the Java model in a modular fashion by using
methods
18
19. • CLOCK: A variable defining simulated time
• INITIALIZATION METHOD: A method to define the system
state at time 0.
• MIN-TIME EVENT METHOD: A method that identifies the
imminent event , i.e, the element of the future event list that has
smallest time stamp.
• EVENT METHODS: for each type, a method to update system
state when that event occurs
19
20. • RANDOM-VARIATE GENERATORS: Methods to generate samples from
desired probability distributions
• MAIN PROGRAM: to maintain overall control of the event-scheduling
algorithm.
• REPORT GENERATOR: A method that computes summary statistics from
cumulative statistics and prints a report at the end of the simulation.
• The overall structure of Java simulation program can be explained through
a flow chart which is an expansion of the Event scheduling algorithm
20
23. SIMULATION IN GPSS
• GPSS is a highly structured ,special purpose simulation
programming language based on the process interaction
approach and oriented towards queuing systems
• There are 40 standard blocks in GPSS.
• Blocks represents events, delays and other actions that
affect transaction flow
23
24. • First version by IBM in 1961.
• GPSS/H is the widely used version . Unlike the original
IBM implementation GPSS/H includes built-in files and
screen I/O , use of an arithmetic expression as a block of
operand , an interactive debugger, faster execution ,
expanded control statements , ordinary variables and
arrays.
• Single-server queue simulation in GPSS/H 24