Unit 4 Simulation software. Introduction Software used to develop simulation models can be divided into 3 categories: – General-purpose programming languages:

Slides:



Advertisements
Similar presentations
Introduction into Simulation Basic Simulation Modeling.
Advertisements

Table of Contents Chapter 12 (Computer Simulation: Basic Concepts)
—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-1 Day 2 Section 3 - Introduction to Process Simulation –Modeling.
Chapter 3 General Principles
Modeling & Simulation. System Models and Simulation Framework for Modeling and Simulation The framework defines the entities and their Relationships that.
 1  Outline  performance measures for a single-server station  discrete-event simulation  hand simulation  process-oriented simulation approach.
Agenda Main concepts in discrete-event simulation
Lecture 3 Concepts of Discrete-Event Simulation. 2 Discrete Event Model  In the discrete approach to system simulation, state changes in the physical.
Chapter 3 Simulation Software
Classification of Simulation Models
DISCRETE-EVENT SIMULATION CONCEPTS and EVENT SCHEDULING ALGORITHM
Components and Organization of Discrete-event Simulation Model
Simulation.
Simscript II.5 Building simulation model with SIMSCRIPT II.5.
Queueing Models: Data Collection and Hand Simulation from Prof. Goldsman’s lecture notes.
CPSC 531: DES Overview1 CPSC 531:Discrete-Event Simulation Instructor: Anirban Mahanti Office: ICT Class Location:
Lecture 4 Mathematical and Statistical Models in Simulation.
Lab 01 Fundamentals SE 405 Discrete Event Simulation
Slide - 1 Dr Terry Hinton 6/9/05UniS - Based on Slides by Micro Analysis & Design An example of a Simulation Simulation of a bank: Three tasks or processes:
Modeling and Simulation
(C) 2009 J. M. Garrido1 Object Oriented Simulation with Java.
Simulation Examples ~ By Hand ~ Using Excel
1 Performance Evaluation of Computer Networks: Part II Objectives r Simulation Modeling r Classification of Simulation Modeling r Discrete-Event Simulation.
 1  Outline  world view of simulation  overview of ARENA  simple ARENA model: Model  basic operations: Model
General Simulation Principles
Operations management using System Dynamics Part II.
ETM 607 – Discrete Event Simulation Fundamentals Define Discrete Event Simulation. Define concepts (entities, attributes, event list, etc…) Define “world-view”,
Chapter 3 General Principles Banks, Carson, Nelson & Nicol Discrete-Event System Simulation.
1 QUEUES. 2 Definition A queue is a linear list in which data can only be inserted at one end, called the rear, and deleted from the other end, called.
Example simulation execution The Able Bakers Carhops Problem There are situation where there are more than one service channel. Consider a drive-in restaurant.
+ Simulation Design. + Types event-advance and unit-time advance. Both these designs are event-based but utilize different ways of advancing the time.
Dept. Computer Science, Tianjin Uni. 系统仿真 System Simulation 2008.
Chapter 2 – Fundamental Simulation ConceptsSlide 1 of 46 Chapter 2 Fundamental Simulation Concepts.
SIMULATION OF A SINGLE-SERVER QUEUEING SYSTEM
Simulation Examples and General Principles
NETW 707 Modeling and Simulation Amr El Mougy Maggie Mashaly.
1 Simulation Implementation Using high-level languages.
Chapter 2 Fundamental Simulation Concepts
Reid & Sanders, Operations Management © Wiley 2002 Simulation Analysis D SUPPLEMENT.
MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,
Chapter 2 Simulation Examples
Simulation of Operations The Discrete Event Approach to Computer Modelling.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
Computer Simulation of Networks ECE/CSC 777: Telecommunications Network Design Fall, 2013, Rudra Dutta.
Heuristic Methods for the Single- Machine Problem Chapter 4 Elements of Sequencing and Scheduling by Kenneth R. Baker Byung-Hyun Ha R2.
Network Protocol Simulation: A look at Discrete Event Simulation Grant D. Lanterman 5/21/2004.
Discrete Event Simulation
(C) J. M. Garrido1 Objects in a Simulation Model There are several objects in a simulation model The activate objects are instances of the classes that.
CHAPTER 3 Simulation Software 1. World Views of Simulation Model Event-Scheduling View  Focus on processing each event Process-interaction View  View.
Advantages of simulation 1. New policies, operating procedures, information flows and son on can be explored without disrupting ongoing operation of the.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
 Simulation enables the study of complex system.  Simulation is a good approach when analytic study of a system is not possible or very complex.  Informational,
Chapter 3 General Principles Banks, Carson, Nelson & Nicol Discrete-Event System Simulation.
Ch. 3 General Principles Discrete-event simulation The basic building blocks of all discrete-event simulation models : entities and attributes, activities.
MODELING AND SIMULATION CS 313 Simulation Examples 1.
Simulation Examples And General Principles Part 2
Discrete-Event System Simulation in Java. Discrete Event Systems New dynamic systems New dynamic systems Computer and communication networks Computer.
Introduction to Modeling & Simulation Dr. A. K. Dey Third Lecture
1 Simulation Software. 2 Introduction The features that should be programmed in simulation are: Generating random numbers from the uniform distribution.
Chapter 2 Simulation Examples. Simulation steps using Simulation Table 1.Determine the characteristics of each of the inputs to the simulation (probability.
Modeling and Simulation
OPERATING SYSTEMS CS 3502 Fall 2017
Discrete Event Simulation
Modeling and Simulation CS 313
Chapter 10 Verification and Validation of Simulation Models
More Explanation of an example in chapter4
Simulation Software.
Concepts In Discrete-Event Simulation
Chapter 4: Simulation Designs
CSI4124/SYS5110– Foundations on Modeling and Simulation
Presentation transcript:

Unit 4 Simulation software

Introduction Software used to develop simulation models can be divided into 3 categories: – General-purpose programming languages: Fortran, C and C++. – Simulation programming languages: GPSS/H and SIMAN V. – Simulation packages 2

History of Simulation Software : the period of search : the advent : the formative period : the expansion period : the period of consolidation and regeneration : the period of integrated environments 3

History of Simulation Software The period of search: – Simulation was conducted in fortran – Much effort was expended in the search for unifying concepts and the development of reusable routines to facilitate simulation. The advent: – Simulation programming languages (SPL)appeared in this period eg, GPSS, Simscript and GASP( General Activity Simulation Program) – GPSS developed by Gordon was the first process-interaction SPL. – Initial versions of Simscript were influenced by Fortran and were based on event scheduling – GASP originally based on ALGOL and later fortran. – Simula and Control and Simulation language(CSL) among others The formative period: 4

Concepts in Discrete Event simulation Lists are also called as sets, queues or chains. Lists are used to hold both entities and event notices. Events on the list are always ordered by some rule. Event notices on the list are always ranked by the event time. An activity’s duration may be specified in a number of ways: – Deterministic: for eg, always 5 minutes – Statistical: for eg, as a random draw from among 2,5,7 with equal probabilities. – A function depending on system variables : for eg, loading time for iron ore ship as a function of the ship’s allowed cargo weight and the loading rate. Its duration is not affected by the occurrence of other events. 5

Concepts in Discrete Event simulation In contrast to an activity, a delay’s duration is not specified ahead of time, but rather determined by system conditions. A delay ends when some set of logical conditions become true or one or more other events occur. For eg, a customer’s delay in a waiting line may be dependent on the number and duration of service of other customers ahead in line as well as the availability of servers. A delay is sometimes called conditional wait, an activity an unconditional wait. The completion of an activity is an event (primary event), that is managed by placing an event notice on the FEL. The completion of a delay is sometimes called a conditional or secondary event and are not represented by event notices. 6

Example: Able-Baker carhop problem System state: – LQ(t), the no. of callers waiting to be served at time t. – LA(t), 0 or 1to indicate Able being idle or busy at time t. – LB(t), 0 or 1to indicate Baker being idle or busy at time t. Entities: neither the customers nor the servers need to be explicitly represented. Events: – Arrival event – Service completion by Able – Service completion by Baker Activities: – Inter arrival time – Service time by Able – Service time by Baker Delay: customer’s wait in queue until Able or Baker becomes free. 7

Example: Able-Baker carhop problem 8 Clock System state Entities and attributesSet 1Set 2... Future Event List(FEL) Cumulative statistics and counters t(x,y,z,..) (3,t1)- type 3 vent to occur at time t1 (1,t2)- type 1 event to occur at time t Fig. Prototype system snapshot at simulation time t Discrete event simulation proceeds by producing a sequence of system snapshots that represent the evolution of the system through time.

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. Scheduling a future event means that at the instant an activity begins, its duration is computed and the end-of-activity event, together with its event time is placed on the FEL. At any given time t, the FEL contains all previously scheduled future events and their associated event times. t<t1<=t2<=t3<=…..<=tn Here, time t is the value of CLOCK, the current value of simulated time. The event associated with time t1 is called the imminent event ( the next event that will occur). 9

The Event Scheduling/ Time advance algorithm After the system snapshot at simulation time CLOCK = t has been updated, the CLOCK is advanced to simulation time CLOCK = t1, and the imminent event notice is removed from the FEL and the event executed. Execution of imminent event means that a new system snapshot for time t1 is created based on the old snapshot at time t and the nature of the imminent event. This process repeats until the simulation is over. The sequence of actions which a simulator must perform to advance the clock and build a new system snapshot is called the event-scheduling/ time- advance algorithm. 10

The Event Scheduling/ Time advance algorithm 11 Clock System state...Future Event List(FEL) Cumulativ e statistics and counters t(5,1,6) (3,t1)- type 3 vent to occur at time t1 (1,t2)- type 1 event to occur at time t2. (1,t3)- type 1 event to occur at time t3.. Step 1: Remove the event notice for the imminent event (event 3, time t1) from FEL Step 2: Advance CLOCK to imminent event time (advance CLOCK from t to t1) Step 3: Execute imminent event: update system state. Change entity attributes and set membership as needed. Step 4: Generate future events( if necessary) and place their event notices on FEL ranked by event time. Step 5: Update cumulative statistics and counters. Old system snapshot at time t

The Event Scheduling/ Time advance algorithm 12 Clock System state...Future Event List(FEL) Cumulativ e statistics and counters t1(5,1,5) (1,t2)- type 1 event to occur at time t2 (1,t3)- type 1 event to occur at time t New System Snapshot at time t1 Fig. Advancing simulation time and updating system image

The Event Scheduling/ Time advance algorithm The management of list is called list processing. The major operations involved in FEL are removal of imminent event, addition of a new event to the list and removal of event occasionally. How are future events generated? The system state at time 0 is defined by the initial conditions and the generated of so-called exogenous events.eg. Arrival At time 0, the first arrival event is generated and is scheduled on the FEL. First, an interarrival time is generated, a*; it is added to the current time, CLOCK=t; the resulting event time, t+a* = t*, is used to position the new arrival event notice on FEL. This method of generating an external arrival stream is called bootstrapping. 13

The Event Scheduling/ Time advance algorithm Consider service-completion event. When one customer completes service at current time CLOCK=t, if the next customer is present, then a new service time s*, will be generated for the next customer. The next service completion event will be scheduled to occur at future time t*=t+s*. 14

The Event Scheduling/ Time advance algorithm Every simulation must have a stopping event, called E, which defines how long the simulation will run. There are 2 ways to stop a simulation: 1. At time 0, schedule a stop simulation event at a specified future time TE. Example: simulate a grocery shop for TE= 1 hour 2. Run length TE is determined by the simulation itself. Example: TE is the time of the 100 th service completion at a service center, TE is the time at which a distribution center ships the last carton in a day’s orders. 15

World Views When using a simulation package, a modeler adopts a world view or orientation for developing a model. There are 3 forms: – Event-scheduling world view – Process interaction world view – Activity scanning world view Event-scheduling world view: Analyst concentrates on events and their effect on system state Process interaction world view : – Analyst defines the simulation model in terms of entities / objects and their life cycle as they flow through the system, demanding resources and queueing to wait for resources. – A process is the life cycle of one entity which may contain various activities and events. 16

World Views A process is a time-sequenced list of events, activities and delays, including demands for resources, that define the life cycle of one entity as it moves through a system. 17 Arrival event Begin service End Service event Activity Delay Time Arrival event Delay Begin service Activity End Service event Interaction Customer n+1 Customer n Fig. Two interacting customer processes in a single-server queue

World Views The earlier two approaches use a variable time advance, when all events and system state changes have occurred at one instant of simulated time, the simulation clock is advanced to the time of the next imminent event. The third approach uses a fixed time increment and a rule-based approach to decide whether any activities can begin at each point in simulated time. At each clock advance, the conditions for each activity are checked and if the conditions are true, then the corresponding activity begins. Though this approach is simple in concept, the repeated scanning to determine whether an activity can begin results I slow run time on computers. Hence, modification of this approach is called the three-phase approach, which combines the features of event scheduling with activity scanning 18

World Views Here, activities are divided into two categories, called B and C. B activities: activities bound to occur; all primary events and unconditional activities. C activities: activities or events that are conditional upon certain conditions being true. The simulation proceeds with repeated execution of the three phases until it is completed: Phase A: Remove the imminent event from the FEL and advance the clock to its event time. Remove any other events from the FEL that have the same time. Phase B: Execute all B-type events that were removed from the FEL Phase C: Scan the conditions that trigger each C-type activity and activate any whose conditions are met. Rescan until no additional C-type activities can begin or events occur. 19

Manual Simulation Using Event Scheduling 20