4 manual simulation

Upload: paul-pinto-j

Post on 10-Oct-2015

12 views

Category:

Documents


0 download

TRANSCRIPT

  • Kleber Barcia V.

    Chapter 4

    Manual Simulation

    Manual simulation of discrete

    events

  • Kleber Barcia V.

    Chapter 4

    2

    Important concepts ...

    System

    Model

    System state

    Entity

    Attributes

    Event

    Activities

    A list is a collection of permanent or temporary entities sorted under a certain logic. Example: Customer ordered under FIFO queue.

    An event notice is the record of an event occurring or will occur in the future associated with the data necessary for the execution of the event.

  • Kleber Barcia V.

    Chapter 4

    3

    Important concepts ...

    A event list is a list of event notices for future events sorted based on time of occurrence. Also known as Future Event List (FEL).

    An activity is typically a service time or interarrival time.

    The duration of an activity can be specified in three different ways:

    1. Deterministic (5 minutes)

    2. Statistical (as random numbers 2, 5, 7 with equal probability)

    3. As a function depending on the variables of the system (the loading time of a vessel as a function of loading rate ton/hr)

    Rev. 1

  • Kleber Barcia V.

    Chapter 4

    4

    Example 1: Queue system with two servers

    A computer technical support center is staffed by two people, Abel and

    Baker, who take calls and try to answer questions and solve computer

    problems. The time between calls ranges from 1 to 4 min. Service time

    varies depending on the employee between 2 to 6 min. Abel is more

    experienced and can provide service faster than Baker. Abel has

    priority to serving customers.

    The discrete event model has the following components:

    System State

    LQ (t) = Number of callers waiting to be served at time t

    LA (t) = 0 or 1 indicating that Abel is idle or busy at time t

    LB (t) = 0 or 1 indicating that Baker is idle or busy at time t

    Entities

    Neither clients nor servers are represented explicitly in the model

  • Kleber Barcia V.

    Chapter 4

    5

    Example 1: Queue system with two servers

    Events

    Events of arrival

    The completion of service by Abel

    The completion of service by Baker

    Activities

    Interarrival time defined in the simulation table

    Abel service time defined in the simulation table

    Baker service time defined in the simulation table

    Delay

    The customer waiting in queue until Abel and Baker are available to

    address them

  • Kleber Barcia V.

    Chapter 4

    6

    The Event Scheduling/Time Advance Algorithm

    It is the mechanism that ensures that all events occurring in the

    chronological order in which advances the simulation time. It is

    based on the list of future events (FEL)

    Example 2: Single Server Queue

    A shop has one dependent. Customers arrive randomly at

    intervals of 1-8 min. with an equal chance of occurrence. The

    service time varies from 1-6 min. with a given probability.

    Find the total time the server is busy (B) and the number of

    customers waiting in queue (MQ) in a simulation of 60 min.

    The discrete event model has the following components:

  • Kleber Barcia V.

    Chapter 4

    7

    Example 2: Single Server Queue

    System State

    LQ (t) = number of customers waiting in queue at time t

    LS (t) = number of customers being served at time t

    Entities

    Customers are not explicitly represented in the model

    Events

    Arrivals (A)

    Outputs (D)

    Stopping event (E) scheduled to occur at time 60

  • Kleber Barcia V.

    Chapter 4

    8

    Example 2: Single Server Queue

    Future Event List

    (A, t) Arrival Client will happen at some future time t

    (D, t) out of the client that will occur at a future time t

    (E, t) Stop the simulation will happen in time 60

    Activities

    Interarrival time

    Service time

    Delay

    While the customer waits in queue

    Interarrival time 8 6 1 8 3 8

    Service time 4 1 4 3 2 4

  • Kleber Barcia V.

    Chapter 4

    9

    Example 2: Single Server Queue Simulation Table

    System State Cumulative

    Statistics

    Clock LQ(t) LS(t) Future Event List Comment B MQ

    0 0 1 (D,4) (A,8) (E,60) First A occurs 0 0

    (a*=8) Schedule next A

    (s*=4) Schedule first D

    4 0 0 (A,8) (E,60) First D occurs: (D,4) 4 0

    8 0 1 (D,9) (A,14) (E,60) Second A occurs:(A,8) 4 0

    (a*=6) Schedule next A

    (s*=1) Schedule next D

    9 0 0 (A,14) (E,60) Second D occurs:(D,9) 5 0

    14 0 1 (A,15) (D,18) (E,60) Third A occurs:(A,14) 5 0

    (s*=4) Schedule next D

    15 1 1 (D,18) (A,23) (E,60) Fourth A occurs:(A,15) 6 1

    (Customer delayed)

    18 0 1 (D,21) (A,23) (E,60) Third D occurs: (D,18) 9 1

    (s*=3) Schedule next D

    21 0 0 (A,23) (E,60) Fourth D occurs:(D,21) 12 1

    a * = Interarrival time s * = service time Rev. 1

  • Kleber Barcia V.

    Chapter 4

    10

    Example 3: Extension of Example 2

    Suppose that in the previous example is required to estimate the average time that the customer spends in the system and proportion of customers who spend 4 or more minutes in the system.

    To perform this calculation the system is expanded with the following components:

    Entities

    (Ci, t) represents the client Ci at a time t. Customers are explicitly represented in the model.

    Future Event List

    (A, t, Ci) represents the arrival of client Ci at a future time t

    (D, t, Cj) represents the output of Cj client at a future time t

    Three new statistics should be calculated:

    Rev. 1

  • Kleber Barcia V.

    Chapter 4

    11

    Example 3: Extension of Example 2

    S = the sum of the time customers spend in the system

    F = The amount of customers who spend 4 or more minutes being attended

    ND = The number of customers leaving the system

    Considering the simulation table, the average time the customer spends in the system is:

    S/ND = 15/4 = 3.75 minutes

    The proportion of customers who spend 4 or more minutes in the system is:

    F/ND = = 0.75

    Rev. 1

  • Kleber Barcia V.

    Chapter 4

    12

    Example 3: Extension of example 2 Simulation Table

    System State List Future Event

    Cumulative

    Statistic

    Clock LQ(t) LS(t) CHECKOUT LINE List S ND F

    0 0 1 (C1,0) (D,4,C1) (A,8,C2) (E,60) 0 0 0

    4 0 0 (A,8,C2) (E,60) 4 1 1

    8 0 1 (C2,8) (D,9,C2) (A,14,C3) (E,60) 4 1 1

    9 0 0 (A,14,C3) (E,60) 5 2 1

    14 0 1 (C3,14) (A,15,C4) (D,18,C3) (E,60) 5 2 1

    15 1 1 (C3,14)(C4,15) (D,18,C3) (A,23,C5) (E,60) 5 2 1

    18 0 1 (C4,15) (D,21,C4) (A,23,C5) (E,60) 9 3 2

    21 0 0 (A,23,C5) (E,60) 15 4 3

  • Kleber Barcia V.

    Chapter 4

    13

    Example 4: Dump Trucks (DT)

    Six dump trucks are used to transport coal from the entrance of a

    mine to a train transport. Each truck is loaded in two loading areas.

    After loaded, the truck is moved to the weighing section. The system

    works on the FIFO system. The travel time between the loading area

    and weighing is negligible. After weighing, the trucks travel, unload

    and return to the loading queue.

    Estimate the loader and scale utilizations (percentage of time busy)

  • Kleber Barcia V.

    Chapter 4

    14

    Example 4: Dump Trucks (DT)

    Loading

    time Probability

    Cumulative

    Probability

    Random

    Digits

    5 0.30 0.30 1-3

    10 0.50 0.8 4-8

    15 0.20 1.00 9-0

    Weighing

    Time Probability

    Cumulative

    Probability

    Random

    Digits

    12 0.70 0.70 1-7

    16 0.30 1.00 8-0

    Travel

    Time Probability

    Cumulative

    Probability

    Random

    Digits

    40 0.40 0.40 1-4

    60 0.30 0.70 5-7

    80 0.20 0.90 8-9

    100 0.10 1.00 0

    Distribution of weighing time for trucks

    Distribution of loading time for trucks

    Distribution of travel time for trucks

  • Kleber Barcia V.

    Chapter 4

    15

    Example 4: Dump Trucks (DT)

    The discrete event model has the following components:

    System State

    LQ (t) = Number of trucks waiting in line to load

    L (t) = Number of trucks loading (0, 1, or 2)

    WQ (t) = Number of trucks waiting in line to weigh

    W (t) = Number of trucks weighing (0 or 1)

    Entities

    The six dump trucks (DT1, DT2, DT3, DT4, DT5 and DT6), are not represented explicitly in the model

    Future Event List

    (ALQ, t, DTi) Dti arrives at loader queue ALQ at time t

    (EL, t, DTi) Dti ends loading EL at time t

    (EW, t, DTi) DTi ends weighting EW at time t

  • Kleber Barcia V.

    Chapter 4

    16

    Example 4: Dump Trucks (DT)

    List (checkout list)

    Loader queue = All trucks waiting to be loading FIFO

    Weigh queue = All trucks waiting to be weighed FIFO

    Activities

    Loading time

    Weighing time

    Travel time

    Delays

    Delay at loader queue

    Delay at scale

    assumptions:

    For t = 0, three trucks are at loader queue, two trucks are loading, and one truck is weighing.

  • Kleber Barcia V.

    Chapter 4

    17

    0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150

    DT1

    DT2

    DT3

    DT4

    DT5

    DT6

    Wait before loading

    Loading

    Wait before weighing

    weighing

    traveling

    Loading

    time 10 5 5 10 15 10 10

    Weighing

    time 12 12 12 16 12 16

    Travel

    time 60 100 40 40 80

    5 12 24

    25 64 72 36 76 52 92 144

    Example 4: Dump Trucks (DT)

    SYSTEM ACTIVITIES

  • Simulation Table Dump Trucks

    System State List Cumulative

    Statistics Clock Loader Weigh Future Event

    t LQ(t) L(t) WQ(t) W(T) Queue Queue List BL BS

    0 3 2 0 1 DT4 (EL,5,DT3) 0 0

    DT5 (EL,10,DT2)

    DT6 (EW,12,DT1)

    5 2 2 1 1 DT5 DT3 (EL,10,DT2) 10 5

    DT6 (EL,5+5,DT4)

    (EW,12,DT1)

    10 1 2 2 1 DT6 DT3 (EL,10,DT4) 20 10

    DT2 (EW,12,DT1)

    (EL,10+10,DT5)

    10 0 2 3 1 DT3 (EW,12,DT1) 20 10

    DT2 (EL,20,DT5)

    DT4 (EL,10+15,DT6)

    where:

    BL = Total busy time that spent the two loading areas

    BS = total busy time that spent the weighing area

  • Simulation Table Dump Trucks

    System State List Cumulative

    Statistics Clock Loader Weigh Future Event

    t LQ(t) L(t) WQ(t) W(T) Queue Queue List BL BS

    12 0 2 2 1 DT2 (EL,20,DT5) 24 12

    DT4 (EW,12+12,DT3)

    (EL,25,DT6)

    (ALQ,12+60,DT1)

    20 0 1 3 1 DT2 (EW,24,DT3) 40 20

    DT4 (EL,25,DT6)

    DT5 (ALQ,72,DT1)

    24 0 1 2 1 DT4 (EL,25,DT6) 44 24

    DT5 (EW,24+12,DT2)

    (ALQ,72,DT1)

    ALQ,24+100,DT3)

    25 0 0 3 1 DT4 (EW,36,DT2) 45 25

    DT5 (ALQ,72,DT1)

    DT6 (ALQ,124,DT3)

  • Simulation Table Dump Trucks

    System State List Cumulative

    Statistics Clock Loader Weigh Future Event

    t LQ(t) L(t) WQ(t) W(T) Queue Queue List BL BS

    36 0 0 2 1 DT5 (EW,36+16,DT4) 45 36

    DT6 (ALQ,72,DT1)

    (ALQ,36+40,DT2)

    (ALQ,124,DT3)

    52 0 0 1 1 DT6 (EW,52+12,DT5) 45 52

    (ALQ,72,DT1)

    (ALQ,76,DT2)

    (ALQ,52+40,DT4)

    (ALQ,124,DT3)

    64 0 0 0 1 (ALQ,72,DT1) 45 64

    (ALQ,76,DT2)

    (EW,64+16,DT6)

    (ALQ,92,DT4)

    (ALQ,124,DT3)

    (ALQ,64+80,DT5)

  • Simulation Table Dump Trucks

    System State List Cumulative

    Statistics Clock Loader Weigh Future Event

    t LQ(t) L(t) WQ(t) W(T) Queue Queue List BL BS

    72 0 1 0 1 (ALQ,76,DT2) 45 72

    (EW,80,DT6)

    (EL,72+10,DT1)

    (ALQ,92,DT4)

    (ALQ,124,DT3)

    (ALQ,144,DT5)

    76 0 2 0 1 (EW,80,DT6) 49 76

    (EL,82,DT1)

    (EL,76+10,DT2)

    (ALQ,92,DT4)

    (ALQ,124,DT3)

    (ALQ,144,DT5)

    where:

    BL = Total busy time that spent the two loading areas

    BS = total busy time that spent the weighing area

  • Kleber Barcia V.

    Chapter 4

    22

    Example 4: Dump Trucks (DT)

    Percentage of time busy of the loader area:

    (49/2) / 76 = 0.32

    Percentage of time busy of the scale area:

    76/76 = 1.00

    ----- HOMEWORK 6 at SIDWeb -----