1 Simulation Implementation Using high-level languages.

Slides:



Advertisements
Similar presentations
Simulating Single server queuing models. Consider the following sequence of activities that each customer undergoes: 1.Customer arrives 2.Customer waits.
Advertisements

Ceng-112 Data Structures I Chapter 5 Queues.
COL 106 Shweta Agrawal and Amit Kumar
Modeling & Simulation. System Models and Simulation Framework for Modeling and Simulation The framework defines the entities and their Relationships that.
Lab Assignment 1 COP 4600: Operating Systems Principles Dr. Sumi Helal Professor Computer & Information Science & Engineering Department University of.
 1  Outline  performance measures for a single-server station  discrete-event simulation  hand simulation  process-oriented simulation approach.
Comp 245 Data Structures Queues. Introduction to the Queue ADT It is a FIFO (first-in, first-out) structure Access to the Queue can take place at two.
Simulation. Example: A Bank Simulator We are given: –The number of tellers –The arrival time of each customer –The amount of time each customer requires.
1 6.3 Binary Heap - Other Heap Operations There is no way to find any particular key without a linear scan through the entire heap. However, if we know.
CS Data Structures I Chapter 7 Queues II. 2 Topics Queue Application Simulation Comparison of List, Stack and Queue.
COSC2006 Chapter 8 Queues III
Classification of Simulation Models
DISCRETE-EVENT SIMULATION CONCEPTS and EVENT SCHEDULING ALGORITHM
© 2006 Pearson Addison-Wesley. All rights reserved8-1 Chapter 8 Queues CS102 Sections 51 and 52 Marc Smith and Jim Ten Eyck Spring 2008.
Components and Organization of Discrete-event Simulation Model
Simulation with ArenaChapter 2 – Fundamental Simulation Concepts Discrete Event “Hand” Simulation of a GI/GI/1 Queue.
Cmpt-225 Queues. A queue is a data structure that only allows items to be inserted at the end and removed from the front Queues are FIFO (First In First.
Simulating Single server queuing models. Consider the following sequence of activities that each customer undergoes: 1.Customer arrives 2.Customer waits.
Simulation Waiting Line. 2 Introduction Definition (informal) A model is a simplified description of an entity (an object, a system of objects) such that.
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
Cmpt-225 Simulation. Application: Simulation Simulation  A technique for modeling the behavior of both natural and human-made systems  Goal Generate.
 1  Outline  simulating GI/G/1 queues  M/M/1 queues  theoretical results of queueing systems  an inventory system  simulation program with an event.
Graduate Program in Engineering and Technology Management
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:
Simulation Examples ~ By Hand ~ Using Excel
© 2006 Pearson Addison-Wesley. All rights reserved8 A-1 Chapter 8 Queues (slightly modified by Dan Fleck)
TK1924 Program Design & Problem Solving Session 2011/2012 L6: Queues.
Stacks and Queues Introduction to Computing Science and Programming I.
General Simulation Principles
ETM 607 – Discrete Event Simulation Fundamentals Define Discrete Event Simulation. Define concepts (entities, attributes, event list, etc…) Define “world-view”,
Entities and Objects The major components in a model are entities, entity types are implemented as Java classes The active entities have a life of their.
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.
Data Structures Using C++ 2E Chapter 8 Queues. Data Structures Using C++ 2E2 Objectives Learn about queues Examine various queue operations Learn how.
+ 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.
CSC 205 Programming II Lecture 22 Carwash Simulation.
Data Structures Using Java1 Chapter 7 Queues. Data Structures Using Java2 Chapter Objectives Learn about queues Examine various queue operations Learn.
SIMULATION OF A SINGLE-SERVER QUEUEING SYSTEM
Simulation Examples and General Principles
OPERATING SYSTEMS CS 3530 Summer 2014 Systems with Multi-programming Chapter 4.
NETW 707 Modeling and Simulation Amr El Mougy Maggie Mashaly.
Chapter 2 Fundamental Simulation Concepts
MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,
Chapter 8 Queues. © 2004 Pearson Addison-Wesley. All rights reserved 8-2 The Abstract Data Type Queue A queue –New items enter at the back, or rear, of.
Discrete Event Simulation
Dr. Anis Koubâa CS433 Modeling and 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.
CDA6530: Performance Models of Computers and Networks Chapter 8: Statistical Simulation ---- Discrete Event Simulation (DES) TexPoint fonts used in EMF.
Advantages of simulation 1. New policies, operating procedures, information flows and son on can be explored without disrupting ongoing operation of the.
 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,
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To introduce the basic concepts of linked lists ❏ To introduce the basic concepts.
Unit 4 Simulation software. Introduction Software used to develop simulation models can be divided into 3 categories: – General-purpose programming languages:
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.
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
Chapter 1 What is Simulation?. Fall 2001 IMSE643 Industrial Simulation What’s Simulation? Simulation – A broad collection of methods and applications.
Data Structures Using C++ 2E
Discrete Event Simulation
COMPUTER 2430 Object Oriented Programming and Data Structures I
Concepts In Discrete-Event Simulation
Discrete Event “Hand” Simulation of a GI/GI/1 Queue
MECH 3550 : Simulation & Visualization
Chapter 4: Simulation Designs
CSCS-200 Data Structure and Algorithms
SIMULATION EXAMPLES QUEUEING SYSTEMS.
Presentation transcript:

1 Simulation Implementation Using high-level languages

2 Implementation of a Single- Server Queuing System Two Main Entities SERVER: Busy= 0/1 QUEUE: Qsize= # Two Critical Events – for customers Arrival Complete Service (Depart) How do these entities interact? Initialization? How are each of the variables affected? How should simulation terminate?

3 Snapshot or System Image State of the system at a given time State variables Queue Future Events List (FEL)

4 Generating Future Events Bootstrapping: a method for generating an arrival stream on an “as you go” basis As opposed to generating all events at once a.k.a. on-the-fly

5 Generating Future Events Process 1. Generate initial arrival; when it is removed from FEL generate new interarrival time - add to clock for arrival time- place next arrival on FEL 2. When item is placed in service, generate service time - add to clock – place completion event on FEL

6 DATA Structures Future Events List (FEL) Queue (1 or more) What information is required for each one? What information is not required but might be convenient? When and how are insertions & deletions made? When are various units of information generated (calculated)?

7 Queue Standard FIFO Customer identification Time entered queue Arrival time Type of service being requested (if more than one)

8 Future Events List Array implementation Each row represents a specific event Customer ID (identification number) Time of occurrence Search for smallest time to get the “next event”

9 Future Events List Linked List ordered by time of occurrence Event Type Time of Occurrence Identification of customer

10 Generating Arrivals Initialize at a fixed time or time zero One for each type of arrival Subsequent arrivals are generated as arrival is removed Remove arrival- generate IAT- add to current time (clock) - put on FEL At any time, there should only be one arrival of any given type

11 Generating Departures Complete Service Generated when customer enters the service that will cause the departure Not necessarily upon arrival, not if enter queue, only when enter service Enter service (from queue or from arrival) - generate service time - add to current time (clock) - put on FEL

12 Generating Events Terminate Event Only one: placed on FEL at initialization Snapshot Event (Status Report) Initialize 1 st one Remove from FEL- add time unit - return to FEL

13 What? Me Simulate? Paper by Dr. Halverson

14 Generation of Events Initialization of FEL One arrival (of each type) Snapshot Stop event Generation of Arrival When removed from FEL, generate next arrival

15 MAIN Initialize FEL, statistical variables, clock Remove next-event from FEL While not stop-event Clock = next-event.time Case next-event of Arrival: produce next arrival call ARRIVE Departure: call DEPART Snapshop: call SNAPSHOT Remove next-event from FEL Stop-simulation: call STATS; call OUTPUT

16 ARRIVE If server_status = busy Then call ENTER-QUEUE Else call ENTER-SERVICE

17 DEPART If queue = empty Then server_status= free Else call REMOVE-FROM-QUEUE

18 ENTER-SERVICE server_status = busy Generate departure event Update service stats

19 ENTER-QUEUE Add customer to queue Update queue statistics

20 REMOVE-FROM-QUEUE Update queue and statistics Call ENTER-SERVICE

21 STATS Compute final averages, totals, etc. IAT, Service time, Utilization Queue length, max, min, average Number arrivals, departures Wait time, Time in system

SNAPSHOT Generate next Snapshot event, place in FEL Print State variables Print Queue Print FEL 22

23 OUTPUT Print results

PROJECT #1 Must follow the guidelines presented in class for the form of your program. Must use object oriented approach Print out of Code due in 1 week 24