233cs chapter 1

Upload: shmook-alaez

Post on 14-Apr-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 233CS Chapter 1

    1/21

    1

    Chapter-1 :Basic Simulation Modeling

    1.1The nature of simulation

    1.2 Systems, Models and Simulation

    1.3 Discrete-Event Simulation1.3.1 Time-Advance Mechanisms

    1.3.2 Components and organization of

    Discrete Event Simulation Model

  • 7/27/2019 233CS Chapter 1

    2/21

    2

    1.1 The Nature of

    Simulation(( Conceptions

    Application areas

    Academic level Impediments

  • 7/27/2019 233CS Chapter 1

    3/21

    3

    Conceptions Simulation course is about techniques for using computers to

    imitate or simulate the operations of various kinds of realworld facilities or processes

    System: the facility or process of interest

    Model(): a set of assumptions about how the systemworks, which usually take the form of mathematical or logicalrelationships, constitute a model that is used to try to gain

    more understanding of how the corresponding system

    behaves.

    Analytic solution(): to obtain exact information onquestions of intresets.

    Simulation)(:use a computer to evaluate a modelnumerically, and data are gathered in order to estimate the

    desired true characteristics of the model.

  • 7/27/2019 233CS Chapter 1

    4/21

    4

    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.

  • 7/27/2019 233CS Chapter 1

    5/21

    5

    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 acomputer system

    Designing and operating transportation systems such as

    airports, freeways, ports and subways

    Evaluating designs for service organizations such as callcenters, fast-food restaurants, hospitals, and post offices

    Reengineering of business processes

    Determining ordering polices for an inventory system

    Analyzing financial or economic systems

  • 7/27/2019 233CS Chapter 1

    6/21

    6

    Academic level

    Winter Simulation Conference (600-700 people

    every year)

    It isone of the three important operations-

    research techniques (in serveys related to theuse 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)

  • 7/27/2019 233CS Chapter 1

    7/21

    7

    Impediments Models used to study large-scale systems tend

    to be very complex, and writing computerprograms 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, simulationmethodology)

  • 7/27/2019 233CS Chapter 1

    8/21

    8

    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 theaccomplishment 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, relativeto 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)

  • 7/27/2019 233CS Chapter 1

    9/21

    9

    Continue... Study on a system: try to gain some insight

    into the relationships among variouscomponents, or to predict performance under

    some new conditions being considered.

    Ways to study a system

  • 7/27/2019 233CS Chapter 1

    10/21

    10

    System

    Experimentwith the

    actual system

    Physical

    model

    Analytical

    solutionSimulation

    Experimentwith a model

    of the system

    Mathematical

    model

    Figure 1.1 Ways to study a system

  • 7/27/2019 233CS Chapter 1

    11/21

    11

    Example If one wants to study on a bank to determine

    the number of tellers needed to provideadequate service for customers who want

    just to cash a check or make a savings

    deposit, the system can be defined to bethat 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

    obvious way.

  • 7/27/2019 233CS Chapter 1

    12/21

    12

    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

  • 7/27/2019 233CS Chapter 1

    13/21

    13

    1.3 Discrete-Event Simulation Discrete-event simulation concerns the

    modeling of a system as it evolves overtime by a representation in which the state

    variables change instantaneously at

    separate points in time. Or the systemcan 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.

  • 7/27/2019 233CS Chapter 1

    14/21

    14

    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 oridle), 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 thecompletion of service for a customer, which

    results in the customers departure.

  • 7/27/2019 233CS Chapter 1

    15/21

    15

    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.

  • 7/27/2019 233CS Chapter 1

    16/21

    16

    Example 1.2Notation:

  • 7/27/2019 233CS Chapter 1

    17/21

    17

    e0 e1 e2 e3 e4 e5

    0 t1 t2 c1 t3 c2

    A1 A2 A3

    S1 S2

    Time

    Figure 1.2 The next-event time-advance approach illustrated for the single-

    server queuing system

  • 7/27/2019 233CS Chapter 1

    18/21

    18

    1.3.2 Components and Organization of

    a Discrete -Event Simulation Model

    Components 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

  • 7/27/2019 233CS Chapter 1

    19/21

    19

    Initialization routine: A subprogram to initialize the

    simulation model at time 0

    Timing routine: A subprogram that determines thenext 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 togenerate random observations from probability

    distributions that were determined as part of the

    simulation model

  • 7/27/2019 233CS Chapter 1

    20/21

    20

    Report generator: A subprogram that computes

    estimates (from the statistical counters) of thedesired 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 andthen transfers control to the corresponding

    event routine to update the system state

    appropriately. The main program may also

    check for termination and invoke the reportgenerator when the simulation is over.

  • 7/27/2019 233CS Chapter 1

    21/21

    21

    Start

    1. Set simulation

    clock=0

    2. Initialize system state

    and statistical counters

    3. Initialize event list

    0. Invoke the initialization routine

    1. Invoke the timing routine2. Invoke event routine

    1. Determine the next

    event type, say, i

    2. Advance thesimulation clock

    1.Update system state

    2.Update statistical counters

    3.Generate future events and add toevent list

    Repeatedly

    Initialization routine Main program Time routine

    Event routine i

    Generate random

    variates

    Library routines

    Issimulation

    over?

    1. Compute estimates of interest

    2. Write report

    Stop

    Report generator

    10

    2

    i

    No

    Yes