Chap10 Simulation

58
1 Simulation Chapter Ten

description

Simulación investigación de operaciones

Transcript of Chap10 Simulation

Page 1: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 1/58

1

Simulation

Chapter Ten

Page 2: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 2/58

2

13.1 Overview of Simulation

When do we prefer to develop simulation model over an analytic

model? When not all the underlying assumptions set for analytic model are valid.

When mathematical complexity makes it hard to provide useful results. When “good” solutions (not necessarily optimal are satisfactory.

! simulation develops a model to numerically evaluate a system

over some time period.

"y estimating characteristics of the system# the best alternative 

from a set of alternatives under consideration can $e selected.

Page 3: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 3/58

3

Continuous simulation systems monitor the system each

time a change in its state takes place.

Discrete simulation systems monitor changes in a state

of a system at discrete points in time.

%imulation of most practical pro$lems re&uires the use of

a computer program.

13.1 Overview of Simulation

Page 4: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 4/58

4

!pproaches to developing a simulation model'sing addins to )xcel such as *+isk or Crystal "all

'sing general purpose programming languages such as,-+T+!/# 0123# 0ascal# "asic.

'sing simulation languages such as 40%%# %56!/# %1!6.

'sing a simulator software program.

13.1 Overview of Simulation

6odeling and programming skills# as well asknowledge of statistics are re&uired when implementing

the simulation approach.

Page 5: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 5/58

5

10.2 Monte Carlo Simulation

6onte Carlo simulation generates random events.

+andom events in a simulation model are needed

 when the input data includes random varia$les.

To reflect the relative fre&uencies of the random

varia$les# the random number mapping method is

used.

Page 6: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 6/58

6

7ewel 8ending Company (78C installs and

stocks vending machines.

"ill# the owner of 78C# considers the installation

of a certain product (“%uper %ucker” 9aw

$reaker in a vending machine located at a newsupermarket.

JEWEL VEN!N" COM#$N% &

an example for the random mapping techni&ue

Page 7: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 7/587

:ata The vending machine holds ;< units of the product.

The machine should $e filled when it $ecomes half empty. :aily demand distri$ution is estimated from similar vending machine

placements. 0(:aily demand = < 9aw $reakers = <.3< 0(:aily demand = 3 9aw $reakers = <.3> 0(:aily demand = 9aw $reakers = <.< 0(:aily demand = @ 9aw $reakers = <.@< 0(:aily demand = A 9aw $reakers = <.< 0(:aily demand = > 9aw $reakers = <.<>

"ill would like to

estimate the

expected num$erof days it takes

for a filled machine

to $ecome half empty.

"ill would like to

estimate the

expected num$erof days it takes

for a filled machine

to $ecome half empty.

JEWEL VEN!N" COM#$N% &

an example of the random mapping techni&ue

Page 8: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 8/588

Solution

E'(e)ted time *etween refills

 !s t+is t+e ,ood value or onl- a ,ood

  estimation

days165.2

40

)5(05.)4(20.)3(30.)2(20.)1(15.)0(10.

40

 

Page 9: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 9/58

9

<.3<<.3>

<.<<.@<

<.<

<.<>

< 3 @ A >

+andom num$er mapping uses the pro$a$ility function

to generate random demand.

! num$er $etween << and BB

is selected randomly.

<<<B 3<> AA A>DA D>BA B>BB

@A@A

The daily demand is determined

$y the mapping demonstrated $elow.

@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A

2/2/

andom num*er ma((in, &

+e #ro*a*ilit- fun)tion $((roa)+ 

emand

Page 10: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 10/58

10

3.<<<.B>

<.D>

<.A>

<.>

<.3<

3 @ A ><

<.@A

3.<<

<.<<

andom num*er ma((in, &

+e Cumulative istri*ution $((roa)+ 

The daily demand E is

determined $y the random

num$er F $etween

< and 3# such that E is the

smallest value for which

-(E ≥F.

-(3 = .> G .@A

-( = .A> H .@A

F = <.@A

2

Page 11: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 11/58

11

! random demand can $e generated $y hand (for

small pro$lems from a ta$le of pseudo random

num$ers.'sing )xcel a random num$er can $e generated

$y

The +!/:( functionThe random num$er generation option (ToolsH:ata

!nalysis

Simulation of t+e JVC #ro*lem

Page 12: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 12/58

12

2andom 3wo 4irst 3otal emand

a- Num*er i,its emand to ate

3 C><C C> @ @

? DDC3 DD A D

@ C3D< C3 @ 3<

A ;;<< ;; A 3A> A?33 A? ? 3C

C DA>? DA @ 3B

2andom 3wo 4irst 3otal emanda- Num*er i,its emand to ate

3 C><C C> @ @

? DDC3 DD A D

@ C3D< C3 @ 3<

A ;;<< ;; A 3A> A?33 A? ? 3C

C DA>? DA @ 3B

Simulation of t+e JVC #ro*lem

%ince we have two digit pro$a$ilities# we use the first two

digits of each random num$er.

<<<B 3<> A>DA D>BA B>BBAA

< 3 @ A > 3

!n illustration of generating a daily random demand.

Page 13: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 13/58

13

The simulation is repeated and stops once total demand reaches

A< or more.

Simulation of t+e JVC #ro*lem

2andom 3wo 4irst 3otal emand

a- Num*er i,its emand to ate

3 C><C C> @ @

? DDC3 DD A D

@ C3D< C3 @ 3<

A ;;<< ;; A 3A> A?33 A? ? 3C

C DA>? DA @ 3B

2andom 3wo 4irst 3otal emanda- Num*er i,its emand to ate

3 C><C C> @ @

? DDC3 DD A D

@ C3D< C3 @ 3<

A ;;<< ;; A 3A> A?33 A? ? 3C

C DA>? DA @ 3B

The num$er of “simulated” days

re&uired for the total demand to

reach A< or more is recorded.

Page 14: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 14/58

14

The purpose of performing the simulation runs is to find the

average num$er of days re&uired to sell A< 9aw $reakers.

)ach simulation run ends up with (possi$ly a different num$er

of days.

! hypothesis test is conducted to test whether or not µ = 3.

/ull hypothesis I< , µ  = 3

!lternative hypothesis I! , µ  ≠ 3

Simulation esults and 5-(ot+esis ests

Page 15: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 15/58

15

The test,:efine α (the significance level.

1et n $e the num$er of replication runs."uild the tstatistic

The t-statistic can be used if the random variable observed

(number of day required for the total demand to be 40 or more) is

normally distributed, hile the standard deviation is un!non"+e9ect I<  if t H tα/? or t G tα/?

(tα2? has n3 degrees of freedom.

n2s

Et   µ−=

Simulation esults and 5-(ot+esis ests

Page 16: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 16/58

16

Trials = 3

6ax=JK sales = <

% = <K % = <:ay = <

:etermine

 :aily demand (:

%ales = %ales L :

:ay = :ay L 3

%ales G A<

+ecord day

% = % L day

% = % L :ay

TrialsG 6ax )nd

Trials = Trials L 3

%ales = <

:ay = <

JVC & $ 4low C+art

-low charts help guide the simulation program

Fes

/o

/o

Fes

Page 17: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 17/58

17

JVC & E')el S(reads+eet

=6!E(!>,!3<>

=5-(C>GA<#!>L3#MM

=5-(C>GA<#81N'0(+!/:(#ONO,O1O33##MM

=5-(C>GA<#"LC>#MM

81N'0

T!"1)

)nter this

data

:rag !>,C> to

!3<>,C3<>

:rag !>,C> to

!3<>,C3<>

Page 18: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 18/58

18

!fter running 3< simulation replications on )xcel# we have

the following results.

  /um$er of days to sell

A< or more 7aw

"reakers   e(li)ation a-s

1   3;

2   3A3   3C

  3C

6   3C

/   3A

7   3A

8   3B

9   3B

10   ?<

 

= (3;L3AL3...L< 2 3< = 3.

s = P(3;3.L(3A3.L...L(<3.Q = >.3>>

t = (3. 3 / P .D</  Q = <.;@

-or α = <.<> and n3 = B degrees of freedom #

t<.<>/ = ..

 

= (3;L3AL3...L< 2 3< = 3.

s = P(3;3.L(3A3.L...L(<3.Q = >.3>>

t = (3. 3 / P .D</  Q = <.;@

-or α = <.<> and n3 = B degrees of freedom #

t<.<>/ = ..

E

10

s >.3>>C ?.?D<C= =

Page 19: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 19/58

19

JVC & E')el S(reads+eet

=()@32)A

=T:5%T(!"%(I>#B#

R  The pvalue =.BJ This value is &uite high

compared to any reasona$le significance level.

R  :ased on t+is data t+ere is insuffi)ienteviden)e to infer t+at t+e mean num*er of

da-s differs from 1/.

Page 20: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 20/58

20

)stimating the !verage /um$er of :ays "efore a

+efill is needed.To o$tain more relia$le results more runs are made.

%ummary of results

  e(li)ations $vera,e ; of da-s t value t<0.026=  3< 3.< <.;@ .

  >< 3D.<A @.@@D 3.B

  3<< 3. .BB 3.B

  ><< 3.@B @.;;B 3.B  ><< 3.> 33.>; 3.B

3<<<< 3.A <.D;> 3.B

 The S value

Page 21: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 21/58

21

:etermining Confidence 5ntervalsWhat is our $est estimate for µ?

Confidence interval might help answer this &uestion

When n G@<# a (3α confidence interval is

When # a (3α confidence interval is

n is the num$er of replications.)xample, n = 3<<<<# B> confidence interval is P3.A#3.><Q

UE t s n # E L t s n V2?#n(3 2?−α α

UE t s n # E L t s n V2?#n(3 2?−α α

n ≥ @<

{X s n, X }/2 /2− + z z s nα α 

{X s n, X }/2 /2− + z z s nα α 

Page 22: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 22/58

23

13.6 Simulation Modelin, of

!nventor- S-stems5nventory simulation models are used when underlying

assumptions needed for analytical solutions are not

met.Typical inputs into the simulation model arerder cost

Iolding cost1ead time

:emand distri$ution

-(i)al out(ut is t+e avera,e total )ostfor a ,iven inventor- (oli)-

Page 23: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 23/58

24

-re&uently# the #i$ed-Time %imulation approach is

appropriate for the modeling of inventory pro$lems. The system is monitored periodically.

The activities associated with demand# orders# and shipments

are determined# and the system is updated accordingly.

Typical output is the average total cost for a giveninventory policy.

10.3 Simulation Modelin, of !nventor-

S-stems & )ontinued

Page 24: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 24/58

25

-re&uently# the #i$ed-Time %imulation approach

is appropriate for the modeling of inventorypro$lems.

The system is monitored periodically.

The activity associated with demand# orders# and

shipments is determined# and the system is updated.

Page 25: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 25/58

26

$LLEN $##L!$NCE COM#$N%

!llen !ppliance stocks and sells a certain $read maker.

:ata'nit cost is O<.

!nnual holding cost rate is rders are placed at the end of a week# and arrive at the

$eginning of a week.

rdering cost is OA> per order.

"ackorder cost is O> per unit per week."ackorder administrative cost is O per unit.

Page 26: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 26/58

27

:istri$utionsThe num$er of retailers that wish to purchase $read makers can $e

descri$ed $y the 0oisson distri$ution with λ = .The demand per customer is given $y the following empirical distri$ution

 0(demand = 3 = <.3<

 0(demand = = <.3>

 0(demand = @ = <.A< 0(demand = A = <.@>

The lead time has the following empirical distri$ution

0(lead time = 3 weeks = <.0(lead time = weeks = <.

0(lead time = @ weeks = <.

W+at is t+e o(timal

inventor- (oli)-

for $llen

W+at is t+e o(timal

inventor- (oli)-

for $llen

Page 27: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 27/58

28

!nventor- S-stems

(+#6 , order point# order up to level  when the inventory level reaches +# the firm orders

enough to $ring the stock to a level 6 when the

orders arrives

(+# , order point# order &uantity

  the firm orders units the level of the stock reachesthe inventory level +

Page 28: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 28/58

29

!verage weekly demand =

<.3<(3L<.3>(L<.A<(@L<.@>(A = @ units

Weekly holding cost =

Ch=(annual holding costXWholesale cost2>

  = (XO<<2> = O3 per unit per week

!verage lead time for delivery =

<.(3 L <.( L <.(@ = weeks

Page 29: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 29/58

30

SOL>!ON

Constructing random num$er mappings for,

The num$er of retailers

Who order in a week

 (λtk eλt

  kY

λ = K t = 3 week

0(E = k =

0(< = <.@>< <<<3@A

0(3 = <.D3Z 3@>A<>

0( = <.D3 A<D

0(@ = <.3;<

0(A = <.<B<

0(> = <.<@

0( = <.<3

0(D = <.<<@

0(; = <.<<3

0(B = <.<<3

  <  <<<3@A

3  3@>A<>

A<D

  @ DD;>

  A ;>DBA  > BADB;

  B;@BBA

  D BB>BBD

  ; BB;

  B BBB

+etailers[

demand

3 <<<B

3<A@ >A

A >BB

1ead time

3 week <3

weeks D@ weeks ;B

Page 30: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 30/58

31

There are several cases of inventory cost to consider,There is inventory at the $eginning and at the end of a week.

!verage inventory = (5nitial inventory L )nding inventory / 

Weekly holding cost = Ch (!verage inventory

There are $ackordered units at the $eginning and at the end of

a week.

!verage $ackorder = (initial $ackorders L ending $ackorders/

Weekly $ackorder cost = Cs(!verage $ackorder L

π(additional $ackorders during the week

Page 31: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 31/58

32

There is inventory at the $eginning# and $ackordered units at the

end of a week.  (!verage inventory =

  ( 0roportion of time “in stock& (!verage inventory

(!verage $ackorder =(0roportion of time “out of stock”(!verage $ackorder

  Iolding cost and $ackorder costs are calculated as $efore.

)xample ,

Page 32: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 32/58

33

)xample ,%tock at the $eginning of the week , @

:emand during the week , ;

/um$er of $ackorders at the end of the week , >!ssumption ,

instock period , @2; of the week

outofstock period , >2; of the week+esults

!verage inventory level=.@D>(3.>L<.>(<= .>> units

Iolding cost for the week = .>>(O3=O.>>

!verage $ackorder level=.@D>(<L<.>(.>= 3.>> units

"ackorder cost for the week=3.>>(O>L>(O =O3D.;3>

Page 33: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 33/58

34

%imulation of the (+# system

 !nventor- emand :a)?orders @ eorderin, Costs

WN "3 +3 \! + : )3 !3 "" \" )" !" +@ 1T IC "C !C +C TC

3 > >< @@ @

  B; A  D 3; 3.> < < < O3.> < < < O3.>

3; DD @ @

  B3 A

  B A

  33 D 3.> < < < O3.> < < OA> O>D.>

5nitial inventory

+andom num$er

/um$er of orders

+andom num$er :emand

)nding inventory

!verage inventory

"eginning $ackorders

)nding $ackorders

!verage $ackorders 1ead time

Iolding cost

!3(O3

"ackorder cost

!"(O>π(\"

rder cost OA>

5nitial inventory )nding inventory!n order must $e placed

$ecause ending inventory is less

than the reorder point (=3<

Page 34: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 34/58

35

%imulation of the (+# %ystem.

!nventor- emand :a)?orders @ eorderin, Costs

WN "3 +3 \! + : )3 !3 "" \" )" !" +@ 1T IC "C !C +C TC

@ D 3D A; @ <

  ; AD < @.> < < < 3 O@.> < < < O@.>

A < ;;< A D @

  B A

  A @

  <

  3 < < 3 3 < < @< A < O>A

> 3@ A3 AA @ <

;A A

  D B.> < < < B @ OB.> < < OA> O>A.>5nitial inventory+andom num$er

/um$er of orders

+andom num$er :emand

)nding inventory

!verage inventory

"eginning $ackorders

)nding $ackorders

!verage $ackorders 1ead time

Iolding cost

!3(O3

"ackorder cost

!"(O>π(\"

rder cost OA>

5nitial inventory

)nding inventory

(<L32O>(!verage inventoryO(/um$er of new $ackorders

"eginning inventory =

ending inv. last weekL order received

$ackorders accumulated = < L> 3

Page 35: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 35/58

36

+esults for ten simulated weeks!verage weekly cost for the (+# policy is

(3.>< L >D.>< L @.>< L >A.<< L J / 3< = O@<.;

!verage weekly cost for the (+#6 policy is OD.B<

"ased on ten weeks runs the (+#6 policy is preferred.

6ore runs are needed to su$stantiate this result.

Page 36: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 36/58

37

10. Simulation of a Aueuin, S-stem

5n &ueuing systems time itself is a random varia$le.

Therefore# we use the ne$t event simulation approach.

The simulated data are updated each time a new event

takes place (not at a fixed time periods.

The process interactive approach is used in this kind of

simulation (all relevant processes related to an item as it

moves through the system# are traced and recorded.

Page 37: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 37/58

38

C$#!$L :$NB

$n e'am(le of ueuin, s-stem simulationCapital "ank is considering opening the $ank on

%aturdays morning from B,<< a.m.

6anagement would like to determine the waitingtime on %aturday morning $ased on the following

data,

Page 38: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 38/58

39

C$#!$L :$NB

:ata, There are > teller positions of which only three will

$e staffed.

!nn :oss is the head teller# experienced# and fast. "ill 1ee and Carla :omingueS are associate tellers less

experienced and slower.

Page 39: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 39/58

40

C$#!$L :$NB

:ata, %ervice time distri$utions,

!nn[s %ervice Time :istri$ution "ill and Carla[s %ervice Time :istri$ution

%ervice Time 0ro$a$ility %ervice Time 0ro$a$ility

.> minutes .<> 3 minute .<>

3 .3< 3.> .3>

3.> .< .<

.@< .> .@<

.> .< @ .3<@ .3< @.> .3<@.> .<> A .<>

A.> .<>

Page 40: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 40/58

41

C$#!$L :$NB

:ata, Customer interarrival time distri$ution

 interarrival time 0ro$a$ility

.> 6inutes .>3 .3>

3.> .3>

.<>

%ervice priority rule is first come first served

! simulation model is re&uired to analySe the service .

Page 41: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 41/58

42

Calculating expected values, )(interarrival time = .>(.>L3(.3>L3.>(.3>L(.<> = .;<

minutes PD> customers arrive per hour on the average#

(<2.;=D>Q

)(service time for !nn = .>(.<>L3(.3<LJL@.>(.<> =

minutes P!nn can serve <2=@< customers per hour on the

averageQ

)(%ervice time for "ill and Carla = 3(.<>L3.>(.3>LJ

LA.>(.<> = .> minutes P"ill and Carla can serve <2.>=A

customers per hour on the averageQ.

C$#!$L :$NB & Solution

Page 42: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 42/58

43

To reach a steady state the $ank needs to employ all

the three tellers (@<L(A = D; H D>.

C$#!$L :$NB & Solution

Page 43: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 43/58

44

5f no customer waits in line# an arriving customer seeks service $ya free teller in the following order, !nn# "ill# Carla.

5f all the tellers are $usy the customer waits in line and takes then

the next availa$le teller.The waiting time is the time a customer spends in line# and iscalculated $y

   'Time service beginsQ minus 'rrival Time 

C$#!$L :$NB & +e Simulation lo,i)

Page 44: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 44/58

45

C$#!$L & Simulation emonstration

6apping 5nterarrival time

;< ] BA 3.> minutes

6apping !nn[s %ervice time

@> ] A minutes

3.6!nn"ill

1.61.6

1.6 1.6 1.61.6

1.6

1.61.61.6

Page 45: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 45/58

46

C$#!$L & Simulation emonstration

6apping 5nterarrival time

;< ] BA 3.> minutes

6apping "ill[s %ervice time

A< ] B .> minutes

!nn"ill 3 6.6

3.61.6

Page 46: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 46/58

47

C$#!$L & Simulation emonstration

3.63Waiting time

Page 47: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 47/58

48

Average Waiting Time in Line =   1.670

Average Waiting Time in System =   3.993

Waiting Waiting

Random Arrival Random Time Time

Customer Number Time Number Start Finish Start Finish Start Finish Line System

1 0.87 1.5 0.96 1.5 5 0 3.5

2 0.18 2.0 0.76 2 5 0 3.0

3 0.49 2.5 0.78 2.5 5.5 0 3.0

4 0.86 4.0 0.49 5 7 1 3.0

5 0.54 4.5 0.85 5 8.5 0.5 4.0

6 0.61 5.0 0.55 5.5 8 0.5 3.0

7 0.91 6.5 0.90 7 10 0.5 3.58 0.64 7.0 0.62 8 10.5 1 3.5

Ann Bill Carla

C$#!$L & 1000 Customer Simulation

Page 48: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 48/58

49

Average Waiting Time in Line =   1.670

Average Waiting Time in System =   3.993

Waiting Waiting

Random Arrival Random Time Time

Customer Number Time Number Start Finish Start Finish Start Finish Line System

1 0.87 1.5 0.96 1.5 5 0 3.5

2 0.18 2.0 0.76 2 5 0 3.0

3 0.49 2.5 0.78 2.5 5.5 0 3.0

4 0.86 4.0 0.49 5 7 1 3.0

5 0.54 4.5 0.85 5 8.5 0.5 4.0

6 0.61 5.0 0.55 5.5 8 0.5 3.0

7 0.91 6.5 0.90 7 10 0.5 3.58 0.64 7.0 0.62 8 10.5 1 3.5

Ann Bill Carla

C$#!$L & 1000 Customer Simulation

This simulation estimates two performance measures, !verage waiting time in line (W& = 3.D minutes

!verage waiting time in the system W = @.BB@ minutes

This simulation estimates two performance measures, !verage waiting time in line (W& = 3.D minutes

!verage waiting time in the system W = @.BB@ minutes

To determine the other performance measures# we can use1ittle[s formulas, !verage num$er of customers in line 1& =(32.;<(3.D = .<;D> customers

!verage num$er of customers in the system = (32.;<(@.BB@ = A.BBcustomers.

To determine the other performance measures# we can use1ittle[s formulas, !verage num$er of customers in line 1& =(32.;<(3.D = .<;D> customers !verage num$er of customers in the system = (32.;<(@.BB@ = A.BB

customers.

!verage interarrival

time = .;< minutes.

Page 49: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 49/58

50

Ma((in, for Continuous andom Varia*les

)xampleThe )xplicit inverse distri$ution method can $e used to

generate a random num$er E from the exponentialdistri$ution with µ = (i.e. service time is exponentiallydistri$uted# with an average of customers perminute.

+andomly select a num$er from the uniform distri$ution $etween <and 3. The num$er selected is F = .@@@;.

%olve the e&uation, E = -3(F = ] (32µln(3 ] F =

](32ln(3.@@@; = .<@ minutes.

Page 50: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 50/58

51

Ma((in, for Continuous andom Varia*les &

>sin, E')el

=+!/:(

:rag to cell "3@ =1/(3"A2O"O3

:rag to cell C3@

Page 51: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 51/58

52

)xcel can generate continuously distri$uted

random num$ers for various distri$ution.

/ormal =/+65/8"eta, =")T!5/8

Chi s&uared, =CI55/8

4amma, =4!66!5/8

andom num*ers and E')el

Page 52: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 52/58

53

andom num*ers

Normall- distri*uted *- E')el &

=/+65/8(+!/:(#O"O3#O"O

:rag to cell "A

Page 53: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 53/58

54

  Simulation of an M @ M @ 1 Aueue

!pplying the process interaction approach  we have,

/ew arrival time = 0revious arrival time L +andom interarrival time.

%ervice finish time = %ervice start time L +andom service time.

! customer 9oins the line if there is a service in progress (its arrival

time G current service finish time .

! customer gets served when the server $ecomes idle.

Waiting times and num$er of customers in line and in the system

are continuously recorded.

Page 54: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 54/58

55

L$N4O S>: S5O#

$n e'am(le of t+e M@M@1 ueuin, simulation

1anford %u$ %hop sells sandwiches prepared $y its only

employee# the owner -rank 1anford.

-rank can serve a customer in 3 minute on the average

according to an exponential distri$ution.

:uring lunch time# 33,@< a.m. to 3,@< p.m.# an average of @<

customers an hour arrive at the shop according to a 0oissondistri$ution.

Page 55: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 55/58

56

L$N4O S>: S5O#>sin, simulationD 4ran?

 wants to determine t+eavera,e time a )ustomer

must wait for servi)e

>sin, simulationD 4ran?

 wants to determine t+eavera,e time a )ustomer

must wait for servi)e

Page 56: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 56/58

57

L$N4O S>: S5O#  Solution

5nput :ata

 λ = @<# µ = <.

:ata generated $y the simulation, C\ = The num$er of the arriving customer.

+\3 = The random num$er used to determine interarrivals.

5!T = The interarrival time.

!T = The arrival time for the customer.

T%" = The time at which service $egins for the customer.

WT = The waiting time a customer spends in line. +\ = The random num$er used to determine the service time.

%T = The service time.

T%) = The time at which service end for the customer

Page 57: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 57/58

58

The interarrival time = ln(3<.A33 / @< = <.<3; hours = 3.<B minutes

C; ;1 !$ $ S: W ;2 S SE

3 <.>< .3< .3< .3< < <.DD3 3.> @.

<.3D< 3.B A.< A.< < <.;;<< .3 .3A

@ <.A33 3.<B >.33 .3A 3.<@ <.DA> 3.@D D.>3

A <.33; <.> >.@ D.>3 .3> <.A<3 <.>3 ;.<

> <.<@@> <.<D >.A@ ;.< .>B <.BB <.BB B.<3 <.>A; 3.>B D.< B.<3 3.BB <.3<;> <.33 B.3

D <.3B; <.@D D.@B B.3 3.D@ <.BB 3.3B 3<.@3

; <.3B <.@D D.D 3<.@3 .>> <.<D <.<@ 3<.@A

B <.@3D> <.D ;.> 3<.@A 3.; <.DB>B 3.>B 33.B@

3< <.AB>; 3.@D B.;B 33.B@ .<A <.A;3 <.> 3.AB

C; ;1 !$ $ S: W ;2 S SE

3 <.>< .3< .3< .3< < <.DD3 3.> @.

<.3D< 3.B A.< A.< < <.;;<< .3 .3A

@ <.A33 3.<B >.33 .3A 3.<@ <.DA> 3.@D D.>3

A <.33; <.> >.@ D.>3 .3> <.A<3 <.>3 ;.<

> <.<@@> <.<D >.A@ ;.< .>B <.BB <.BB B.<3 <.>A; 3.>B D.< B.<3 3.BB <.3<;> <.33 B.3

D <.3B; <.@D D.@B B.3 3.D@ <.BB 3.3B 3<.@3

; <.3B <.@D D.D 3<.@3 .>> <.<D <.<@ 3<.@A

B <.@3D> <.D ;.> 3<.@A 3.; <.DB>B 3.>B 33.B@

3< <.AB>; 3.@D B.;B 33.B@ .<A <.A;3 <.> 3.AB

The explicit inverse method

!rrival time of customer @ = !rrival time of customer L 3.<B = A.< L 3.<B

Waiting time = .3A >.33

)nd of service = .3AL3.@D

!verage waiting time =

(< L < L3.<@ L ... L.<A 2 3< = 3.>B

!verage waiting time =(< L < L3.<@ L ... L.<A 2 3< = 3.>B

L$N4O S>: S5O# &

Simulation for first 10 Customers

ime Service EndsService imeime Service :egins$rrival ime

Page 58: Chap10 Simulation

7/17/2019 Chap10 Simulation

http://slidepdf.com/reader/full/chap10-simulation 58/58

L$N4O S>: S5O# &

Simulation for first 1000 Customers