Fundamental Simulation Concepts

download Fundamental Simulation Concepts

of 38

  • date post

    07-Jan-2016
  • Category

    Documents

  • view

    36
  • download

    0

Embed Size (px)

description

Fundamental Simulation Concepts. Chapter 2. What We’ll Do. Underlying ideas, methods, and issues in simulation Software-independent (setting up for Arena) Centered around an example of a simple processing system Decompose the problem Terminology Simulation by hand - PowerPoint PPT Presentation

Transcript of Fundamental Simulation Concepts

  • Fundamental Simulation ConceptsChapter 2

  • What Well Do ...Underlying ideas, methods, and issues in simulationSoftware-independent (setting up for Arena)Centered around an example of a simple processing systemDecompose the problemTerminologySimulation by handSome basic statistical issuesOverview of a simulation study

  • The System:A Simple Processing System

    General intent:Estimate expected productionWaiting time in queue, queue length, proportion of time machine is busyTime unitsCan use different units in different places must declareBe careful to check the units when specifying inputsDeclare base time units for internal calculations, outputsBe reasonable (interpretation, roundoff error)

  • Model SpecificsInitially (time 0) empty and idleBase time units: minutesInput data (assume given for now ), in minutes:Part NumberArrival TimeInterarrival TimeService Time10.001.732.9021.731.351.7633.080.713.3943.790.624.5254.4114.284.46618.690.704.36719.3915.522.07834.913.153.36938.061.762.371039.821.005.3811 40.82..........Stop when 20 minutes of (simulated) time have passed

  • Goals of the Study:Output Performance MeasuresTotal production of parts over the run (P)Average waiting time of parts in queue:

    Maximum waiting time of parts in queue:

    N = no. of parts completing queue waitWQi = waiting time in queue of ith partKnow: WQ1 = 0 (why?) N > 1 (why?)

  • Goals of the Study:Output Performance Measures (contd.)Time-average number of parts in queue:

    Maximum number of parts in queue:Average and maximum total time in system of parts (a.k.a. cycle time):

    Q(t) = number of parts in queue at time tTSi = time in system of part i

  • Goals of the Study:Output Performance Measures (contd.)Utilization of the machine (proportion of time busy)

    Many others possible (information overload?)

  • Pieces of a Simulation ModelEntitiesPlayers that move around, change status, affect and are affected by other entitiesDynamic objects get created, move around, leave (maybe)Usually represent real thingsOur model: entities are the partsCan have different types of entities concurrentlyUsually, identifying the types of entities is the first thing to do in building a model

  • Pieces of a Simulation Model (contd.)AttributesCharacteristic of all entities: describe, differentiateAll entities have same attribute slots but different values for different entities, for example:Time of arrivalDue datePriorityColorAttribute value tied to a specific entityLike local (to entities) variablesSome automatic in Arena, some you define

  • Pieces of a Simulation Model (contd.)(Global) VariablesReflects a characteristic of the whole model, not of specific entitiesUsed for many different kinds of thingsTravel time between all station pairsNumber of parts in systemSimulation clock (built-in Arena variable)Name, value of which theres only one copy for the whole modelNot tied to entitiesEntities can access, change variablesWriting on the wall (rewriteable)Some built-in by Arena, you can define others

  • Pieces of a Simulation Model (contd.)ResourcesWhat entities compete forPeopleEquipmentSpaceEntity seizes a resource, uses it, releases itThink of a resource being assigned to an entity, rather than an entity belonging to a resourceA resource can have several units of capacitySeats at a table in a restaurantIdentical ticketing agents at an airline counterNumber of units of resource can be changed during the simulation

  • Pieces of a Simulation Model (contd.)QueuesPlace for entities to wait when they cant move on (maybe since the resource they want to seize is not available)Have names, often tied to a corresponding resourceCan have a finite capacity to model limited space have to model what to do if an entity shows up to a queue thats already fullUsually watch the length of a queue, waiting time in it

  • Pieces of a Simulation Model (contd.)Statistical accumulatorsVariables that watch whats happeningDepend on output performance measures desiredPassive in model dont participate, just watchMany are automatic in Arena, but some you may have to set up and maintain during the simulationAt end of simulation, used to compute final output performance measures

  • Pieces of a Simulation Model (contd.)Statistical accumulators for the simple processing systemNumber of parts produced so farTotal of the waiting times spent in queue so farNo. of parts that have gone through the queueMax time in queue weve seen so farTotal of times spent in systemMax time in system weve seen so farArea so far under queue-length curve Q(t)Max of Q(t) so farArea so far under server-busy curve B(t)

  • Simulation Dynamics:The Event-Scheduling World ViewIdentify characteristic eventsDecide on logic for each type of event toEffect state changes for each event typeObserve statisticsUpdate times of future events (maybe of this type, other types)Keep a simulation clock, future event calendarJump from one event to the next, process, observe statistics, update event calendarMust specify an appropriate stopping ruleUsually done with general-purpose programming language (C, FORTRAN, etc.)

  • Events for theSimple Processing SystemArrival of a new part to the systemUpdate time-persistent statistical accumulators (from last event to now)Area under Q(t)Max of Q(t)Area under B(t)Mark arriving part with current time (use later)If machine is idle:Start processing (schedule departure), Make machine busy, Tally waiting time in queue (0)Else (machine is busy):Put part at end of queue, increase queue-length variableSchedule the next arrival event

  • Events for theSimple Processing System (contd.)Departure (when a service is completed)Increment number-produced stat accumulatorCompute & tally time in system (now - time of arrival)Update time-persistent statistics (as in arrival event)If queue is non-empty:Take first part out of queue, compute & tally its waiting time in queue, begin service (schedule departure event)Else (queue is empty):Make the machine idle (Note: there will be no departure event scheduled on the future events calendar, which is as desired)

  • Events for theSimple Processing System (contd.)The EndUpdate time-persistent statistics (to end of the simulation)Compute final output performance measures using current (= final) values of statistical accumulatorsAfter each event, the event calendars top record is removed to see what time it is, what to doAlso must initialize everything

  • Some Additional Specifics for theSimple Processing SystemSimulation clock variable (internal in Arena)Event calendar: list of event records:[Entity No., Event Time, Event Type]Keep ranked in increasing order on Event TimeNext event always in top recordInitially, schedule first Arrival, The End (Dep.?)State variables: describe current statusServer status B(t) = 1 for busy, 0 for idleNumber of customers in queue Q(t)Times of arrival of each customer now in queue (a list of random length)

  • Simulation by HandManually track state variables, statistical accumulatorsUse given interarrival, service timesKeep track of event calendarLurch clock from one event to the nextWill omit times in system, max computations here (see text for complete details)

  • Simulation by Hand:Setup

    Chart7

    0

    0

    0

    1

    1

    0

    0

    1

    1

    2

    2

    3

    3

    2

    2

    1

    1

    0

    0

    0

    0

    0

    0

    1

    1

    Input Data

    Arrival timesInterarrival timesDeparture timesService times

    0.001.732.902.90

    1.731.354.661.76

    3.080.708.053.39

    3.790.6212.574.52

    4.4114.2817.034.46

    18.690.7123.044.36

    19.3915.5125.112.07

    34.913.1538.273.36

    38.061.7640.642.37

    39.821.0046.025.38

    40.8210.3050.72

    51.1255.57

    Avg4.083.46

    Hand Sim. Table

    Just-Finished EventVariablesAttributesStatistical AccumulatorsEvent Calendar

    EntityTimeEventArrival Times:

    No.tType(In Queue)In ServicePN[Entity No.,Time,Type]

    [1,0.00,Arr]

    0.00Init00()000.000.000.000.000.0000.00[,20.00,End]

    [2,1.73,Arr]

    10.00Arr01()0.00010.000.000.000.000.0000.00[1,2.90,Dep]

    [,20.00,End]

    [1,2.90,Dep]

    21.73Arr11(1.73)0.00010.000.000.000.000.0011.73[3,3.08,Arr]

    [,20.00,End]

    [3,3.08,Arr]

    12.90Dep01()1.73121.171.172.902.901.1712.90[2,4.66,Dep]

    [,20.00,End]

    [4,3.79,Arr]

    33.08Arr11(3.08)1.73121.171.172.902.901.1713.08[2,4.66,Dep]

    [,20.00,End]

    [5,4.41,Arr]

    43.79Arr21(3.79, 3.08)1.73121.171.172.902.901.8823.79[2,4.66,Dep]

    [,20.00,End]

    [2,4.66,Dep]

    54.41Arr31(4.41, 3.79, 3.08)1.73121.171.172.902.903.1234.41[6,18.69,Arr]

    [,20.00,End]

    [3,8.05,Dep]

    24.66Dep21(4.41, 3.79)3.08232.751.585.832.933.8734.66[6,18.69,Arr]

    [,20.00,End]

    [4,12.57,Dep]

    38.05Dep11(4.41)3.79347.014.2610.804.9710.6538.05[6,18.69,Arr]

    [,20.00,End]

    [5,17.03,Dep]

    412.57Dep01()4.414515.178.1619.588.7815.17312.57[6,18.69,Arr]

    [,20.00,End]

    [6,18.69,Arr]

    517.03Dep00()5515.178.1632.2012.6215.17317.03[,20.00,End]

    [7,19.39,Arr]

    618.69Arr01()18.695615.178.1632.2012.6215.17317.03[,20.00,End]

    [6,23.05,Dep]

    [,20.00,End]

    719.39Arr11(19.39)18.695615.178.1632.2012.6215.17317.73[6,23.05,Dep]

    [8,34.91,Arr]

    [6,23.05,Dep]

    20.00End11(19.39)18.695615.178.1632.2012.6215.78318.34[8,34.91,Arr]

    Hand Sim. Plots

    Event TimeEvent TypeNIQBusy

    0.0000Init00

    0.0000A01

    1.7308A01

    1.7308A11

    2.8956D11

    2.8956D01

    3.0819A01

    3.0819A11

    3.7853A11

    3.7853A21

    4.4098A21

    4.4098A31

    4.6597D31

    4.6597D2