![Page 1: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/1.jpg)
GENERAL PRINCIPLES, SIMULATION SOFTWARE
Unit 5
![Page 2: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/2.jpg)
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
![Page 3: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/3.jpg)
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
![Page 4: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/4.jpg)
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
![Page 5: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/5.jpg)
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
![Page 6: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/6.jpg)
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.
![Page 7: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/7.jpg)
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
![Page 8: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/8.jpg)
8
![Page 9: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/9.jpg)
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
![Page 10: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/10.jpg)
10
![Page 11: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/11.jpg)
11
![Page 12: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/12.jpg)
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
![Page 13: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/13.jpg)
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
![Page 14: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/14.jpg)
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
![Page 15: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/15.jpg)
15
![Page 16: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/16.jpg)
16
![Page 17: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/17.jpg)
17
LIST PROCESSING
• Lists: Basic properties and operations• Using Arrays for list processing• Using dynamic Allocations and Linked Lists
![Page 18: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/18.jpg)
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
![Page 19: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/19.jpg)
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
![Page 20: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/20.jpg)
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
![Page 21: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/21.jpg)
21
![Page 22: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/22.jpg)
22
SINGLE- SERVER QUEUE SIMULATION IN JAVA
![Page 23: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/23.jpg)
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
![Page 24: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/24.jpg)
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
![Page 25: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/25.jpg)
25
![Page 26: Unit 5 general principles, simulation software](https://reader031.vdocuments.net/reader031/viewer/2022021919/587e58fc1a28abeb1a8b7647/html5/thumbnails/26.jpg)
26
END OF UNIT 5Thank you