233CS Chapter 1

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 21

Chapter-1 :Basic Simulation Modeling

1.1The nature of simulation 1.2 Systems, Models and Simulation 1.3 Discrete-Event Simulation 1.3.1 Time-Advance Mechanisms 1.3.2 Components and organization of Discrete Event Simulation Model

1.1 The Nature of Simulation((


Conceptions Application areas Academic level Impediments

Conceptions
Simulation course is about techniques for using computers to imitate or simulate the operations of various kinds of real world facilities or processes System: the facility or process of interest Model(): a set of assumptions about how the system works, which usually take the form of mathematical or logical relationships, constitute a model that is used to try to gain more understanding of how the corresponding system behaves. Analytic solution() : to obtain exact information on questions of intresets. Simulation) ( : use a computer to evaluate a model numerically, and data are gathered in order to estimate the desired true characteristics of the model.
3

Example
a manufacturing company contemplates building a large extension onto one of its plants, but is not sure if the potential gain in productivity would justify the construction cost.

Application areas of Simulation


Designing and analyzing manufacturing systems evaluating military weapons systems or their logistics requirements determining hardware requirements or protocols for communication networks Determining hardware and software requirements for a computer system Designing and operating transportation systems such as airports, freeways, ports and subways Evaluating designs for service organizations such as call centers, fast-food restaurants, hospitals, and post offices Reengineering of business processes Determining ordering polices for an inventory system Analyzing financial or economic systems

Academic level
Winter Simulation Conference (600-700 people every year) It isone of the three important operationsresearch techniques (in serveys related to the use of operations research techniques: math programming, statistics, simulation) The second only to math programming among 13 techniques considered (in 1294 papers from the journal Interfaces from 1970 through 1992)
6

Impediments
Models used to study large-scale systems tend to be very complex, and writing computer programs to execute them can be an arduous task indeed. (excellent software products ) Large amount of computer time is sometimes required. (cheaper and faster computer) An unfortunate impression that simulation is just an exercise in computer programming, albeit a complicated one. (attitude, simulation methodology)

1.2 Systems, Models and Simulation


System is defined to be a collection of entities, e.g., people or machines, which act and interact together toward the accomplishment of some logical end. System depends on the objectives of a particular study. State of a system: collection of variables) (necessary to describe a system at a particular time, relative to the objectives of a study. (the number of busy tellers, the number of customers in the bank, the time of arrival of each customer in the bank)
discrete system: the state variables change instantaneously )( at separated points in time. (a bank, e.g., the number of customers in the bank) continuous system: the state variables change continuously) (with respect to time. (an airplane moving through the air, e.g., position and velocity ) 8

Continue...
Study on a system: try to gain some insight into the relationships among various components, or to predict performance under some new conditions being considered. Ways to study a system

System Experiment with a model of the system Physical model Mathematical model

Experiment with the actual system

Analytical solution
Figure 1.1 Ways to study a system

Simulation
10

Example
If one wants to study on a bank to determine the number of tellers needed to provide adequate service for customers who want just to cash a check or make a savings deposit, the system can be defined to be that portion of the bank consisting of the tellers and the customers waiting in line or being served. If the loan officer and the safety deposit boxes are to be included, the definition of the system must be expanded in an 11 obvious way.

Classification of simulation models


Static vs. dynamic Deterministic vs. stochastic Continuous vs. discrete
Most operational models are dynamic, stochastic, and discrete will be called discrete-event simulation models

12

1.3 Discrete-Event Simulation


Discrete-event simulation concerns the modeling of a system as it evolves over time by a representation in which the state variables change instantaneously at separate points in time. Or the system can change at only a countable number of points in time. Event is defined as an instantaneous occurrence that may change the state of the system.
13

Example 1.1
Single-server queuing system: a barbershop, to estimate the (expected) average delay in queue (line) of arriving customers
State variables: the status of the server (busy or idle), the number of customers waiting in queue to be served, the time of arrival of each person waiting in queue. Events: the arrival of a customer and the completion of service for a customer, which results in the customers departure.
14

1.3.1.Time-Advance Mechanism
Simulation clock: the variable in a simulation model that gives the current value of simulated time.
to keep track of the current value of simulated time as the simulation proceeds to advance simulated time from one value to another

Advancing the simulation clock


next-event time advance (mostly used) fixed-increment time advance (a special case of the first)

Next-event time-advance approach


simulation clock is initialized to zero the times of occurrence of future events are determined.
15

Example 1.2
Notation:

16

e0
0

e1
t1

e2 e3
t2 c1

e4
t3

e5
c2 Time

A1

A2

A3

S1

S2

Figure 1.2 The next-event time-advance approach illustrated for the singleserver queuing system
17

Components

1.3.2 Components and Organization of a Discrete -Event Simulation Model


Systems state: The collection of state variables necessary to describe the system at a particular time Simulation clock: A variable giving the current value of simulated time Event list: A list containing the next time when each type of event will occur Statistical counters: Variables used for storing statistical information about system performance
18

Initialization routine: A subprogram to initialize the simulation model at time 0 Timing routine: A subprogram that determines the next event from the event list and then advances the simulation clock to the time when that event is to occur Event routine: A subprogram that updates the system state when a particular type of event occurs (there is one event routine for each event type) Library routines: A set of subprograms used to generate random observations from probability distributions that were determined as part of the simulation model
19

Report generator: A subprogram that computes estimates (from the statistical counters) of the desired measures of performance and produces a report when the simulation ends Main program: A subprogram that invokes the timing routine to determine the next event and then transfers control to the corresponding event routine to update the system state appropriately. The main program may also check for termination and invoke the report generator when the simulation is over.
20

Start

Initialization routine
1. Set simulation 0 clock=0 2. Initialize system state and statistical counters 3. Initialize event list

Main program
0. Invoke the initialization routine 1. Invoke the timing routine Repeatedly 2. Invoke event routine 2 Event routine i 1.Update system state 2.Update statistical counters 3.Generate future events and add to event list Is simulation over? Report generator No 1

Time routine
1. Determine the next event type, say, i 2. Advance the simulation clock

Library routines Generate random variates

Yes 1. Compute estimates of interest 2. Write report


Stop
21

You might also like