Simscript II.5 Building simulation model with SIMSCRIPT II.5.

Slides:



Advertisements
Similar presentations
Concurrency Important and difficult (Ada slides copied from Ed Schonberg)
Advertisements

—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-1 Day 2 Section 3 - Introduction to Process Simulation –Modeling.
Modeling & Simulation. System Models and Simulation Framework for Modeling and Simulation The framework defines the entities and their Relationships that.
Tasks Periodic The period is the amount of time between each iteration of a regularly repeated task Time driven The task is automatically activated by.
Lecture 3 Concepts of Discrete-Event Simulation. 2 Discrete Event Model  In the discrete approach to system simulation, state changes in the physical.
Chapter 7: Deadlocks (Continuation). 7.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 14, 2005 Chapter 7: Deadlocks.
Classification of Simulation Models
CSIM19 tutorial Reference:
#11 QUEUEING THEORY Systems Fall 2000 Instructor: Peter M. Hahn
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
Components and Organization of Discrete-event Simulation Model
Why Behavioral Wait statement Signal Timing Examples of Behavioral Descriptions –ROM.
Simulation with ArenaChapter 2 – Fundamental Simulation Concepts Discrete Event “Hand” Simulation of a GI/GI/1 Queue.
Simulating Single server queuing models. Consider the following sequence of activities that each customer undergoes: 1.Customer arrives 2.Customer waits.
Computer Organization and Architecture
Simulation Waiting Line. 2 Introduction Definition (informal) A model is a simplified description of an entity (an object, a system of objects) such that.
CPSC 531: DES Overview1 CPSC 531:Discrete-Event Simulation Instructor: Anirban Mahanti Office: ICT Class Location:
CHAPTER 6 FILE PROCESSING. 2 Introduction  The most convenient way to process involving large data sets is to store them into a file for later processing.
Lab 01 Fundamentals SE 405 Discrete Event Simulation
7: Deadlocks1 DEADLOCKS EXAMPLES: "It takes money to make money". You can't get a job without experience; you can't get experience without a job. BACKGROUND:
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:
Chapter 6: CPU Scheduling
TK1924 Program Design & Problem Solving Session 2011/2012 L6: Queues.
Stochastic Processes A stochastic process is a model that evolves in time or space subject to probabilistic laws. The simplest example is the one-dimensional.
Chapter 3 Process Description and Control
ETM 607 – Discrete Event Simulation Fundamentals Define Discrete Event Simulation. Define concepts (entities, attributes, event list, etc…) Define “world-view”,
S.Ducasse Stéphane Ducasse 1 Processes and Concurrency in VW.
- 1 - Embedded Systems - SDL Some general properties of languages 1. Synchronous vs. asynchronous languages Description of several processes in many languages.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
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.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 18: Stacks and Queues (part 3)
CE Operating Systems Lecture 11 Windows – Object manager and process management.
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
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,
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Object Oriented Simulation with OOSimL Conditional Waiting.
(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.
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
CDA6530: Performance Models of Computers and Networks Chapter 8: Statistical Simulation ---- Discrete Event Simulation (DES) TexPoint fonts used in EMF.
C++ Programming Lecture 14 Arrays – Part I The Hashemite University Computer Engineering Department (Adapted from the textbook slides)
 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,
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
One More Try Another Example with Some Tweaks. Fall 2001IMSE 643 Industrial Simulation Two Job Types and a second Workstation Machine Inspection Arrivals.
1 Simulation Software. 2 Introduction The features that should be programmed in simulation are: Generating random numbers from the uniform distribution.
Processes and threads.
HDL simulation and Synthesis (Marks16)
Operating Systems (CS 340 D)
Modeling and Simulation (An Introduction)
Timing Model Start Simulation Delay Update Signals Execute Processes
Discrete Event Simulation
Operating Systems (CS 340 D)
OPERATING SYSTEMS DEADLOCKS
Chapter 6: CPU Scheduling
Operating System Concepts
Operating Systems.
TDC 311 Process Scheduling.
Lecture 2 Part 3 CPU Scheduling
Concepts In Discrete-Event Simulation
Discrete Event “Hand” Simulation of a GI/GI/1 Queue
Chapter 4: Simulation Designs
OPERATING SYSTEMS DEADLOCKS.
DEADLOCKS.
Stochastic Processes A stochastic process is a model that evolves in time or space subject to probabilistic laws. The simplest example is the one-dimensional.
Chapter 3: Process Management
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Simscript II.5 Building simulation model with SIMSCRIPT II.5

Simulation Model Structure Each simulation model has the following 3 activities: A mechanism for representing arrivals of new object (constant delay between successive arrivals, uniform, exponential, etc). A representation of what happens to the object in the model (objects may compete for a service, they will be put in queue if the server is busy) A mechanism for terminating the simulation

Terminating the simulation Two approaches for terminating simulation: The planned-termination-time method : T he simulation stops immediately at the planned time regardless the unfinished processes. The second method allows everything in the model to be finished. However the door will be closed and no new arrivals are allowed.

The Process Concept The dynamic parts in the model that are created They become either immediately after creation or will be activated after some specific time. The description of its activity in the model is given by a process routine.

The Resource Concept A resource is used to model an object that is needed by process objects. If the resource is not available (occupied by another process object) the process object will be placed in a waiting line.

SIMSCRIPT II.5 Program Structure A SIMSCRIPT II.5 program consists of three modeling elements: 1.A preamble 2.A main program 3.A process routine for each process declared in the preamble

1. Preamble The first part of each SIMSCRIPT II.5 program is the preamble. preamble is a declarative and does not include any executable statements. It declares all modeling elements including –processes and resources in the program. It describes their static feature but does not describe how and why they interact.

2. Main It contains executable statements. Execution begins with the first statement in the Main program. Resources must be created and initialized A simulation begins when the statement Start simulation is executed.

Timing Routine All processes will be in the pending list. The timing routine check if there is a process in the pending list and select the one that has the earliest activation time. Then advance the simulation clock to this time Then determine the process type Remove this process from the pending list Execute the process routine.

3. Process Routines Process (entity): is a dynamic object and the sequence of actions that experience through its life in the model. A process is created and becomes active immediately or later at some activation time. Processes interact either implicitly or explicitly through executing the statements: activate, interrupt, or resume. Process routine: is a subroutine, which corresponds to a particular process. Process notice: this record contains information, which characterizes the particular realization.

A Detailed Discussion of Processes and Resources 1- Processes: Each type of process used in a SIMSCRIPT simulation model must be defined in the preamble, Processes include ARRIVAL.GENERATOR and CUSTOMER Where ARRIVAL.GENERATOR and CUSTOMER are two processes. Processes can also have characterizing attributes, In our example, suppose that each CUSTOMER process entity has an associated age attribute called CU.AGE.

process commands We now explain each of the process commands Activate statement : The activate statement is used to create a process notice for a particular process and then immediately place the notice in the event list. The reference variable for this type of process points to the notice.

Activate a CUSTOMER in 10 minutes This statement means that we create a new CUSTOMER process notice with an activation time, which is 10 minutes larger than the current value of the simulation clock, and then place this notice in the event list.

Request/relinquish statement The request statement is used by a particular process entity (or process notice) in its process routine to request a certain number of units of a resource of a specified type. request 1 unit of SERVER(l) or request 1 unit of SERVER(l) with priority 5 Note: the one with the highest priority is served next

Request/relinquish continue If no priority is specified (the usual case), then a priority of 0 is assumed. The relinquish statement is used by a particular process entity (or process notice) to relinquish (release) a certain number of units of a resource of a specified type. relinquish 1 unit of SERVER(l) Note: “1 unit of” may be shortened to “1.”

Work/wait: The work/wait statements are used by a particular process entity, which is executing its process routine, to place its process notice back into the event list for a specified amount of time. A work statement represents "service" times and a wait statement represents "inter-event" (e.g., inter-arrival) times. After one of these statements is executed, control is immediately returned to the timing routine. work 20 minutes

Suspend/reactivate The suspend statement is used by a particular process entity to stop its own execution of the corresponding process routine. (for example when a more priority customer arrives then the current executable customer will be suspended) This results in its process notice moving from the "executing" state to the "created" state. The notice will stay in this latter state until "awakened" by a reactivate "the" (or resume) statement in a process or normal routine. reactivate the CUSTOMER now

Interrupt/resume The interrupt statement is used in a process or normal routine to remove a process notice from the event list. (for example when the time of closing is reached the interrupt statement is used to prevent new customers form entering the system) This results in the process notice moving from the "pending" state to the "created" state. interrupt the CUSTOMER resume the CUSTOMER Note: resume statement can be used to move a suspended process notice from the "created" state to the "pending" state.

Create/destroy: The create statement is used to create a process notice for a particular type of process without placing it into the event list. create a CUSTOMER let CU.AGE (CUSTOMER) = 35 activate this CUSTOMER now The destroy statement is used to destroy (i.e., to make non existent) a process notice which is in the "created" state. destroy the CUSTOMER

End/return The end, return statement is placed at the end of each process routine.

2- Resources A resource is an object such as a person or machine which provides service to a process entity. A resource may have characterizing attributes and is defined in the preamble resources every WORK.STATION has a WS.NUM.MACHINES There are five system-defined variables, which are automatically associated with each defined resource.

1.The variable N.WORK.STATION is the number of types of workstations desired (i.e., 5). 2.Q.WORK.STATION(I), The first set (or queue) contains those jobs waiting to be served by WORK.STATION type I, and the corresponding variable N.Q.WORK.STATION(I) is the number of jobs in the queue at a particular point in time. 3.X.WORK.STATION(I), the second set contains those jobs executing WORK.STATION type I, and the variable type I at a particular point in time.

N.X.WORK.STATION(I) is the number of jobs that are executing WORK.STATION 4.U.WORK.STATION(I) is the number of idle units or machines in WORK.STATION type I at a particular point in time. 5.the variable WORK.STATION (i.e., it has the same name as the resource itself) is an index variable which is equal to one of the WORK.STATION types (i.e., 1, 2, 3, 4, or 5).

In order to allocate storage for the resource WORK.STATION, we can execute the following create statement: create every WORK.STATION(5) (This statement implicitly sets the value of N.WORK.STATION to 5.) we can then specify how many units of each type are initially available.

let U.WORK.STATION(l) = 3 let U.WORK.STATION(2) = 3 let U.WORK.STATION(5) = 1 The variable U.WORK.STATION(I) will decrease by one each time a machine of type I becomes busy; conversely, it will increase by one each time a machine of type I becomes idle.