Вы находитесь на странице: 1из 20

Use of R

For almost all of the questions an R script is provided that helps in carrying through simulations
or optimizations. The scripts are
simulation

optimization

Inv1sim

12ManyDirectDistribution

Inv2sim
12ManyBeDiIndi
InvAux
12ManyOptimizationRoutines
UnitNormalLossFunction
GetIntersectionOfTwo
The main scripts are Inv1sim & Inv2sim (where the latter uses InvAux and
UnitNormalLossFunctionas auxiliary scripts) and 12ManyDirectDistribution &
12ManyBeDiIndi (where the latter uses 12ManyOptimizationRoutines &
GetIntersectionOfTwo as auxiliaries). It is unlikely that in the course of answering
thequestionsyouwishtochangeanythingintheauxiliaries(butyoumaywanttotakea peek to see
what is happening there). In the main scripts you almost invariably need to change some
values only (so no programming). Nonetheless, take some time to learn how the scripts have
been set-up.
For a main script, that uses auxiliaries, to work, you need to put the auxiliaries in the same
(working) directory as the main script.

Part I:

Intro
It is common, when demand is sufficiently high and not extremely variable, to fit a
normaldistributiontothedemanddistributionandthenusethatnormalfitinestablishing inventory
control parameters. Sometimes unease is felt in the use of a normal fit. On the other hand
claims have been made that the normal fit is quite robust for finding a policy that is near
optimal, see the appendix Normal demand to Chapter 7 of the text accompanying the course.
This assignment scrutinizes this claim for some particular cases.
In all cases in Part I below we consider single-item inventory installations where
time is discrete: time is sliced into periods and demand not met from inventory is
backlogged
the inventory policy used is of the (R,S)-type1.
In correspondence with the accompanying text, Chapter 7, in each base period events occur
sequenced as sketched in Figure 1. Any inventory (backlog or on hand) present
bop

eop

receive
supply

demand
comes in

ship (fulfill)
and/or backlog

reorder
supply

Figure 1: Time model for essential events in a single base period. Here bop = begin of period
and eop = end of period.
at the end of periods is carried to the next period.
An order placed arrives, assuming the supplier has sufficient inventory, after a lead time L.
This means that nominally an order placed at the end of period t arrives at the beginning of
period t +1+L. So, if lead time were zero an order placed at the end of a period would be
received at the beginning of the next period.
The general setup for the different questions to be answered for Subparts A and B are
1. compute the optimal policy, that is the value of S, under the normal-distribution
approximation from a given target value for the fill rate (FR); compute the
corresponding value for the average on-hand inventory,

An (R,S) logic can be considered as a special case of an (R,s,S) logic where s = S where is an arbitrary small
number, see the text accompanying the course, Chapter 7 for an introduction to various inventory control
policies.

3
2. simulate the suggested policy, that is, the policy using the value for S just computed, on
the demand data (as given) to uncover whether use of the suggested policy returns the
promised values for FR and the average level of on-hand inventory.
Run the simulation models for a minimum of 4,000 periods.

A: Base Scenario - discrete demand


You do not have to submit answers for Subpart A.
The question serves only to verify the working of the model/R script.
Consider an inventory system subject to discrete demand: demand only assumes a finite
number of values. When inventory is insufficient to meet demand partial shipments are made
even when these would imply non-integer shipment volumes. The review periods length (R)
is three periods and the lead time (L) is one period. The base scenario for a single facility is
contained in the R script Inv1sim.
Consider the demand presented through the parameters broaddm and broadpb in the R
scripts. The parameter broaddm holds 21 volumes that can be assumed by demand in a
period and broadpb holds the 21 values of the probability of corresponding demand volumes.
The demand distribution specified is the demand per period (and each period is assumed to
have the same, independent random demand).
Compute the mean and the standard deviation of the demand distribution implied by
broaddm and broadpb.
Hint. YoumaywanttocheckSubsectionReferencesss:avstdevintheappendicesonPage15 or check the
R script Inv1sim.

For the four scenarios implied by the 22 matrix


FR = 0.9

FR =0.99

demand=narrow demand=broad

determine, under the normal-distribution approximation, the (minimum) target


inventory level S required to attain a fill rate (FR) of assuming that demand per
periodhasanormaldistributionwithmeanandstandarddeviationascomputed from the
demand distribution.
use the R script to run a simulation model2 to find the FR and the average On Hand
inventory when running the model with the order-up-to-level found with the normaldistribution approximation.
Report the found order-up-to levels S, the fill rate, FR, and average on-hand, OH, values in two
tables (and corresponding order-up-to level from the normal distribution approximation) like
in Table 1.

See the appendix, Subsection Referencesssec:app2A, for some hints.

4
FR

Av. OH

normal approx.

.90

??

??

discrete demand (sim)

??

??

??

and

FR

Av. OH

normal approx.

.99

??

??

discrete demand (sim)

??

??

??

Table 1: Reporting values.


with the general compute-simulate scheme from Page 3.
Does the normal-distribution approximation perform well in predicting performance (FR and
average OH) in each of the four scenarios? See the subsection at Page 18 for answers.

B: Two installations in tandem


Intro
Consider two inventory installations, 1 and 2, in tandem. Installation 2 serves as the supplier
to Installation 1 which in turn serves external demand, see Figure 2. Each installation manages
its own inventory: there is no coordinating policy.
(R2,S2)

(R1,S1)

Figure 2: Two inventory installations in tandem. The arrows show the flow of goods.
Installation 1 is assumed to follow an (R,S) policy. An order placed by Installation 1 at the
end of Period t is received by Installation 2 in that same period and furthermore we assume
that Installation 2 can initiate shipment of the order promptly in that same period (assuming
that is has inventory) meaning that the order will be received by Installation 1 after a leadtime delay of L1 at the beginning of Period t + 1 +L1. In case Installation 2 only has sufficient
inventory to ship an order partially then the partial order will be shipped, even if it means
shipping of a non-integer quantity.
Installation 2 also works with an (R,S) policy. In a review period for that installation the
inventory position on which a replenished order is based is observed after having accounted
for a possible receipt of an order from Installation 1 and/or shipment of an
ordertoInstallation2. Notethatashipmentofproductinaperiodcanbeinitiatedeven in case there
is no order received in that period from Installation 1: if Installation 2 receives incoming
replenishment
orders
this
may
enable
it
to
resolve
back
orders
(possiblypartially)byshippingproducttoInstallation1. Infactweassumesthatfulfilmentof back
orders takes priority. For example, assume the following situation at Installation 2 in some
period3
NSbop = 10;

Incoming Repl. Order = 12;

Incoming order from Install. 1 = 5

Bop stands for beginning of period, like eop will stand for end of period.

5
In this case 10 units from the incoming replenishment order are used to clear the backlog and
a further 2 units of the replenishment order are used for fulfilling the current incoming order
from Installation 1. So, this leaves 3 units of the order that will have to be fulfilled in a later
period and thus experience a delay, thereby hurting the fill rate. Note that in case the NSbop at
Installation 2 is positive, so it is on hand, then the volume of product available for shipping is
the sum of the NS and the incoming replenishment order. The lead time for replenishing
Installation 2 is L2.

a) In the following the focus is on the normal demand approximation for the (R,S) policy
pursued by each of the two installations 1 and 2. For cases considered below the following
parameter values apply. Lead time are 1: L1 = 1 = L2. The review interval at Installation 1 has a
length R1 = 3 and at Installation 2 it has a length of R2 = 2. Consider the case of narrow demand,
see R script Inv2sim.
1. Using the normal-distribution approximation compute for Installation 1 the optimal
order-up-to level that achieves a fill rate of 0.85 and compute the optimal order-up-to
level that achieves a fill rate of 0.95. These two order-up-levels are referred to as S(.851)
and S(.951) . Compute the implied on-hand stocks under each of the order up-to levels.
2. Pick one4 of the targets S(.851) and S(.951) for Installation 1 to find
the mean of demand faced by Installation 2 over its lead time + review interval
the standard deviation of demand faced by Installation 2 over its lead time +
review interval.
Explain how you proceed in finding these values.
Using the normal-distribution approximation compute for Installation 2 the optimal
order-up-to level that achieves a fill rate of 0.85 and compute the optimal order-up-to
level that achieves a fill rate of 0.95. These two order-up-levels are referred to as S(.852)
and S(.952) . Compute the implied on-hand stocks under each of the order up-to levels.
Let us now simulate and see whether the calculated values make sense: when implementing
the values will we get the promised service levels? We will be considering the four simulation
scenarios implied by the 22 matrix
S(.852) S(.852)
S(.851)

S(.951)

3. Consider Installation1. Compare thefill rate andaverage on-hand promised(using the


normal-distribution approximation) to what is actually achieved under the simulation
for each of the four scenarios. Compute the average and standard deviation of orders
placed with Installation 2.

Do you think it matters for what follows?

6
4. Consider Installation2. Compare thefill rate andaverage on-hand promised(using the
normal-distribution approximation) to what is actually achieved under the simulation
for each of the four scenarios. Establish (by simulation) the average and standard
deviation of orders placed with the outside supplier.
Now review what has been found.
5. Are there significant differences in predicted (normal-distribution approximation) and
realized (simulation) performances in fill rate and average on hand? Can these be
explained?
6. Consider the variations in external demand in demand exerted at Installation 2 (orders
placed by Installation 1) and orders placed by Installation 2 over appropriate intervals.
Is there a bullwhip effect? Explain.

Part II: Large scale distribution networks

O: Base Scenario: direct distribution


You do not have to submit answers for Subpart O.
The question serves only to verify the working of the model/R script.
Consider a distribution system for distributing a single item from a single central depot or
supply center to a great number of customers. Transportation is executed with identical
trucks. All customers have the same constant demand rate. Further data is in Table 2.
Following Daganzo, (Daganzo 2010, Chapter 3),the costs per unit distributed, z, are given by the
following function of ns and q.
(2E(r) pk ) c 0 pk 1 z(n ,q)= s +ts

i
s
2 +cs + 2E(r) cd +cs n
sq

+kcpd +cs q1

spk t ci
+

+s

n
2

hq
s+

h 1 ns q

+ R

1
1
=0 +1 nsq +2 q +3 ns +4 q +5nsq

with h = cr + c2i and h = cr + 2ci .

Question O.1
For the base case, what are the optimal values for ns and q that result from minimizing the cost
function. Do not activate the truck capacity constraint: assume that truck capacity is
unbounded5. What, at these values, are the values of
the total costs per unit distributed
the total daily costs
the visiting frequency of each destination

In the R-script unbounded capacity can be achieved by setting truck capacity at a very large value.

8
the load, i.e., number of units, in a truck on departure from the central depot?
The resulting optimal values are given in the following table.
q 542.0305789 ns
20.37456486
v
11043.63718
L
0.122994291
z
0.782691674
Table 2: Values for
the base scenario.
symbol description

value
Decision variables

size of a delivery (drop) in units of product at a customer

ns

number of customer stops on a single truck trip

Main problem dimensions


1/
1/
R

area per customer (km2)

1200
2

area time volume per unit of demand (km day) size of


surface area where the customers are located (km2)

18
810,000

Additional problem dimensions


ts
s

duration of a stop (day)

1/8

driving speed of a truck (km/day)


ratio of production (supply) rate at the depot to the total demand rate in
the area
Cost parameters

270
2

cd
cs
cs0
ci
cr

movement (truck): kilometers driven (/km)

cost of a stop ()
cost per unit unloaded ()
inventory carrying: capital (/day per unit)
inventory storage: rent (/day)

100
0.1
0.03
0.02

Other and dependent values


k

conversion factor (root of) density - distance

vmax

capacity of a truck

0.6
8,000

Note1. Thereasonforintroducingvaluesfor andthroughtheirinversesisthatspecification of the values


directly would give (small) fractional values for and , see Appendix at Page 15 for specifics, thereby
creating instabilities through rounding of these small fractional values. Note 2. The value 1/ = 18 means
that you have to observe 18 km2 for one day to see one unit of demand arising (or 9 km2 for two days,
and so on). Similarly, 1/= 1200 means that you will find one customer in 1200 km2 35 km 35 km.

9
Note. Your result should get very close to the value of z reported here. Since the objective
function is quite flat around the optimal values for q and ns may vary a little (but no more than
0.1%).

Question O.2
Consider the base scenario with the constraint that truck capacity is 8000 units. Recompute. Under
this constraint, the resulting optimal values are given in the following table.
q 525.5805849
15.22126296
8000.000291
0.126843853
0.789609641

ns
v
L
z

Note. Use the R script 12ManyDirectDistribution for the questions under O.

C: changing inventory related costs


Continue studying the distribution problem as under O: Base Scenario: direct
distributionwithoutthecapacityconstraintonthevehicles. Inthefollowingonlythevalue(s)of the
parameter(s) mentioned is varied one at a time. For example, considering a change in the cost
of holding inventory, ci, the values of all other values in Table 2 are assumed unchanged.
1. Present expressions for the expected number of kilometers traveled daily and the
expected number of kilometers traveled per unit distributed in terms of decision variables
and parameters of the model.
2. Consider each of the following three cases.
The stock holding charge ci per unit per unit of time increases by 0.002.
The stock space costs cr per unit per unit of time increases by 0.002.
Both the stock holding charge ci per unit per unit of time, ci, and the stock space costs cr
per unit per unit of time increase by 0.002
Discuss for each of these cases separately whether and in which direction (increase or
decrease) the optimal values of
ns (the number of stops at destinations on a tour)
q the drop size
v the load per truck on departure from the depot
Lthe frequency of drops

10
z the costs per distributed product
the expected number of kilometers traveled daily
the expected number of kilometers traveled per unit distributed will change compared
case

drop
size

number of
stops

load

frequency

cost per
item

total km
traveled

km per
item

ns

daily

on average

basis

ci +0.002

cr +0.002
ci&cr +0.002

to the base case. Are the changes intuitive? Explain.


Fill in the following table as part of your answer.

case

drop number of
size stops item
q
ns

load
frequency
traveleditem
v
L

cost per total km


z

daily

km per
on average

Can any of the tendencies of change (in decision variable or resulting costs or other
performance) be easily explained? Which ones are particularly difficult to explain or
even counter-intuitive? Try to explain anyway.
Note. Remember that in each case a single parameter changes while the others are kept
constant.

D: Direct vs indirect, break-even


In the following, use the R script LSbeDist for computations. Consider a two-echelon distribution
system with a central depot and regional distribution centers.
Transport vehicles are capacitated on the distribution segment from the terminals to the
customers. The capacity of the truck driving between the terminals and the customers is vmax(0)
. Trucks going between the depot and the terminals do not have capacity limitations.
In the gross distribution from the central depot to the terminals only one stop is made on a
trip. So, the tours from the depot to the terminals each consist of only one terminal: ns(1) = 1.
As a result, we are left with the following four decision-design variables
{ns(0),q(0),ns(1),q(1),I}.
Further assume that the distribution centers do not involve costs as such: 6 = 0 =7.

11
The costs per unit distributed to a destination at a distance r from the central depot, z, take
the following form as a function of the drop sizes, the number of stops in a tour in the detailed
distribution and the size of a detail delivery area.

z = {ns(0),q(min0),ns(1),q(1),I} ci(1) 2r kpI +t (1)+cs0(1) + cd(1) 2r (1k)qp(1I)+cs(1)


2

s(1)

s(1)

ns

+ cd(1)kqp(I1)+cs(1) + c2i ksp(1)I +t (1)ns(1) + hIq(1) + hR(1) q(1)ns(1)+ s

ci2(0) 34ps(0I) (0k)p +t (0)+cs0(0) + cd(0) 4p3I(0)qp(k0) +cs(0) s


s

ns

+ cd(0) pk +cs(0) + ci(0)

kp

(0) ns(0) +

(0)h(0) q(0) + h(0I)

q(0)ns(0)! +t
q(0)

s(0) s

Allparameters(cost,densities,...) inthetwo-echelonsystemareasinthebasescenario, except


specified differently below.
In the following we wish to not place an a priori bound on the size of the area considered.
To be specific, a value of R = 40004000 = 16106 km2 should suffice, so assume that value.

Detailed distribution Parameter values in the detailed distribution take an upperscript (0).
The driving cost in the detailed distribution is cd(0) = 1.8. Note that this is considerably higher
than the cost in the base scenario.
There is no coordination of incoming and outgoing transport at the regional distribution centers.
This means that we can suppose that h(0) =h(0), that is, (0) = 1.

Coarse-grained distribution

Thecoarse-grainedtransportationismoreefficientthan the

detailed transportation and this is reflected both in the driving speed which in the coarsegrained distribution is twice that in the detailed distribution, s(1) = 2s(0), and in the driving costs
per kilometer which has a value cd(1) =1. All other parameter values in the coarse-grained
distribution take values as in the base scenario.

if

12

Question D.1
Set the capacity of the truck that visits a customer equal to vmax = 4000 units.
1. At which distance, r, from the central depot does the system with transhipment
becomemorecosteffectivethanthesystemwithoutregionaldistributioncenters (terminals)?
Note. Distance from the central depot is in the direct system approximated by the distance
between the depot and the distribution zone, while in the indirect system it is approximated by
the distance between the central depot and terminal from which fine distribution takes place.

2. What happens when vmax increases? Make a table or graph holding the breakeven distance
for different values of the truck capacity. What is the nature of the graph or table? Is there
a linear part? Where (if any)? Explain.
Hint 1. The dependence on distance of the costs per item distributed under direct shipping uses the
model given under Question O.1 except that
optimization needs to be done using a travel cost of cd =1.8 (in stead of 1)
optimization needs to be done under the truck capacity constraint stating that ns q vmax = 4000.
the distance between the depot and the delivery zone assumes a particular value, such as 200
(and is not computed as E(r) from the size of the area that is served).
The R script 12ManyDirectDistribution has already accounted for these differences in a scenario
(which you have to activate).
Hint 2. The R script 12ManyBeDiIndi runs the direct and indirect model for different values of the
distance (as specified in the variable sampleDistances) between the depot and the delivery zone and
field warehouse respectively. The script also plots the values for the costs per unit distributed for the
two cases, direct and indirect, as a function of distance from which you can make an estimate of the
break-even distance. The R script 12ManyBeDiIndi (calling on the script GetIntersectionOfTwo)
computes the break-even distance more precisely in the value IntersectPoints.
Hint 3. When considering different truck capacities you need to calculate break-evens multiple times.
Here you need to develop tables or graphs. Each entry in the graph requires the solution to optimization
problems. You can, of course, do such by hand, that is, change the truck capacity and rerun the script
with another input value and then noting the new break-even value. Alternatively, you can automate
things by doing the required calculations in a for-loop (which you have to program).

E: break-even under varying demand intensity


Continue with considering the direct and indirect problem with values for parameters as
discussed under the text of D: Direct vs indirect, break-even (including under Question D.1).
On the basis of the analysis by DAGANZOs one-to-many model there exists a distance,
which we will call , beyond which indirect distribution is more favorable from a cost
perspective than delivery without transshipment, under the running assumption that the
capacities of trucks for the detailed distribution are smaller than those of the trucks used in
the coarse-grained distribution. The value of , i.e., the break-even distance, clearly depends
on many variables.

13
1. For the situation where (only) the demand intensity, , increases by a factor b, make a
sketch as indicated in Figure 3 showing the way changes.

Figure 3: Break-even distance under varying demand intensity.


Explain your answer. Are the costs curves developed intuitive? Why? In more detail the
change in density of destinations that is considered is in formal notation the following:
becomes larger. For example, put = b 0 where 0 is a starting value for and b is a
scaling factor w.r.t. the starting value. Then b can be considered as the varying value.
Considering the graph developed in Figure 3 discuss whether it goes up/down at an
increasing/decreasing rate, attaining an extremum (maximum or minimum) yes/no.
2. For the situation where (only) both and increases jointly by the same factor b, make a
sketch as indicated in Figure 3 showing the way changes.
Explain your answer. Are the costs curves that you have developed intuitive? Why? In
more detail the change in density of destinations and demand rate density that is
considered is in formal notation the following: and become larger.
For example, put
= b 0 where 0 is a starting value for ,
= b 0 where 0 is a starting value for

Figure 4: Break-even distance varying under varying customer and demand-rate density.
and b is a scaling factor w.r.t. the starting values. Then b can be considered as the
varying value. Considering the graph developed in Figure 4 discuss whether it goes
up/down at an increasing/decreasing rate or that the break-even distance attains an
extremum (maximum or minimum).
3. Comparethecasewhereonlythedemanddensity,,changeswiththecasewhere
both
customer density, , and demand rate density, , change by the same factor. What is the

14
difference in set-up? What is the difference in outcomes? Are these differences intuitive?
Explain.

F: postponement-speculation
It can be argued that a prominent factor in the complexity of optimal network design is
thedesiretoexploiteconomyofscale. Bucklinsexample 6 ,ofapplicationofthepostponementspeculation
principle makes an attempt at including such considerations into analysis of network structure.
Likewise, Sections 4.2 "Factors influencing distribution network design " and 4.3 "Design options for a
distribution network" of (Chopra and Meindl 2013, 5th edition)8 make an attempt at systemizing and
analyzing the choices for network design.
Do the above models/problems in Subparts B,C-E address issues of economy of scale? Where
and in what sense?
Discuss similarities and differences between the approaches
one-to-may (Daganzo)
Bucklin
(Chopra and Meindl 2013) Sections 4.2 and 4.3.
Try to extend the discussions of the differences beyond mere formalities such as this or that
model-problem has more variables or is more complex.
Do the models-problems touch on the postponement-speculation principle? In what sense or
aspect?

References
Chopra,SunilandPeterMeindl(2013).SupplyChainManagement.5thedition.Harlow, England: Pearson
Education.
Daganzo, Carlos F. (2010). Logistics Systems Analysis. Springer.
Stock, James R. and Douglas M. Lambert (1987). StrategicLogisticsMangement. Homewood,Ill.:
Irwin.

See Bucklins paper, or see e.g. (Stock and Lambert 1987, Chapter 3)

15

APPENDICES

Appendices
Normal-distribution loss calculations
When calculating with the normal-distribution approximation under the fill-rate criterion
when needs access to the inverse of the standard-normal first-order loss function, G1, where
G is the standard normal first order loss function. The function G, let alone
G1,isnotavailableinclosedformandoneneedstoreverttotablesoralgorithmswhen using these
functions. Use of look-up tables is fine for doing normal-distribution calculations by hand. If,
however, you want to use R for doing those calculations then you may want to make use of
the functions Gval and invGval that is contained in the R script Inv2sim. Note. Use of the R
code for the unit loss function and its inverse is optional: you can also use lookup tables.

Appendix to Part A
Average and standard deviation from the mass distribution for a discrete variable
The probability mass distribution for a discrete variable is a specification of the probability for
each possible outcome of that variable. Assuming that the variable X can take on a value from
0,.1,2, ,N we would have to specify the values pn = Prob(X = n) for n = 0,1,2, ,N, like in Table
5.

Table 5: Specification of a probability mass distribution


outcome(n)

probability(pn)

0.13

1
...
N

0.07
...
0.04

The script Inv2sim contains code for calculating the mean and standard deviation from a
discrete distribution. When given a probability mass function one can use one of two7 ways to
calculate means and standard deviations (and variances)
calculate quantities from first principle: simply apply the definitions; this has been done in
the R script Inv1sim
drawalargesampleofempiricalvaluesfromthedistribution(forexample,using
the
R
software) and then use this sample to numerically estimate the mean and standard
deviation.
The two ways of calculating are now given as

The second method is approximative, depending on the number of samples used.

16

APPENDICES

1. ApplythedefinitionsFromTable5onecomputestheaverage(mean)throughtheory

as

mean = 00.13+10.07++N 0.04


and the variance as variance =(0mean)2 0.13+(1mean)2 0.07++(N mean)2 0.04
from which the standard deviation computes as

standard deviation =pvariance .


2. Simulate Using R software: the function sample. Get a sample by using the
functionsamplewithsizesetatthenumberofsamplesrequired.
ThenuseRsbuilt-in
functions mean and sd to calculate mean and standard deviation.

Simulation in R
The modeling approach taken to simulate an inventory system is time-slicing 8 . The
implemented model in R uses data frames where columns specify variables observed at
particular times numbered by the rows: rows represent time periods, see Table 6.
Table 6: Inventory dynamics with time periods in rows.
Period

bopNS

bopIP

OrderArrival

Demand

Required

Avail2Ship

Shipped

eopNS

eopIP

CanOrder

40

40

40

37

37

FALSE

37

37

37

29

29

FALSE

29

29

15

15

29

15

14

14

TRUE

23

14

37

14

31

FALSE

31

23

31

25

25

FALSE

25

25

25

23

23

TRUE

14

23

37

23

19

33

FALSE

19

33

14

33

31

31

FALSE

31

31

31

23

23

TRUE

14

10

23

37

23

15

29

FALSE

11

15

29

14

29

22

22

FALSE

12

22

22

15

15

22

15

TRUE

30

13

37

37

FALSE

14

37

30

37

37

37

FALSE

15

37

37

37

33

33

TRUE

16

33

37

33

24

28

FALSE

17

24

28

13

13

28

13

15

15

FALSE

18

15

15

15

14

14

TRUE

23

19

14

37

10

10

14

10

27

FALSE

20

27

23

10

10

27

10

17

17

FALSE

Most of the relationships in the model reflect simple rules of bookkeeping, such as
NSright after order receipt = NSright before order receipt +size of received order

OrderPlaced

A potential drawback of such approach, in general, is that there may be many slices that have no events rendering
the simulation inefficient. This is not the case here. 11Bop stands for begin of period and eop for end of period.

17

APPENDICES

and for t a period we have11 NSbop(t) = NSeop(t 1). There are five matters that are slightly more
involved.

Review period Whether a period is a review period is marked with a TRUE in the column
under CanOrder. The values in this column are computed from the period number through
the modulo operation. The modulo (sometimes called modulus) operation findsthe remainder
of divisionof one number byanother. In thiscase the value is computed for Period t as ((tOffSetValue) %% RevPer) == 0 where RevPer holds the value of the length of the review
period and OffSetValue determines where the multiple-of-RevPer periods start.

Lead time The values in the column under OrderPlaced are shifted over two rows to the
column under OrderArrival. Note that placing orders occurs at the end of periods and that
order arrivals occur at the beginning of periods.

Demand during a period


Demandinaperiodresultsformrandomsampling(where
thefunctionsampleisusedtogeneraterandomnumbersfromadiscretedistribution).
Starting up The first couple of periods are special in that you need to assume how, in what
state, the inventory system starts. For example you can assume that there are no outstanding
replenishment orders at the beginning of Period 1 and the on hand is sufficient to last a few
periods.

FR from simulation Calculate for each period the amount of the incoming demand
thatisservedwithadelaywhileassumingthatbacklogsareservedfirst. Theamountto be served,
the
requirement,
equalsBObop +
Demand
andthe
amount
availablefor
fillingtherequirementequalsOHbop + IncomingReplenishment. One cannowcompute the
amount of demand served with a delay using the four quantities BObop, Demand, OHbop, and
Incoming Replenishment, see the R-script Inv1sim.

Updating
Period-by-period updating of inventory and performance records is carried out in the script Inv1sim
by means of the function UpdateInventoryRecords.

Inventory record updating

The following data are kept in inventory records

symbol

description

formula (in Period t > 1)

bopNS
bopIP
OA

begin of period net stock begin of period inventory position size of order arriving (= amount
ordered L+1 periods ago if supply has not been interrupted in the meantime)

DM
RQ
ATS

volume of incoming demand


sum of incoming and backlog available for
shipping

SH
eopNS
eopIP

the amount shipped to the market/demand


end of period net stock
end of period inventory position (but before reordering)

18

bopNSt = bopNSt1
bopIPt = eopIPtA
1 +OP
t1
PPENDICES
OAt
DMt
RQt = DMt min(0,bopIPt ) ATSt =
OAt +max(0,bopIPt )
SHt = min(DMt ,ATSt )
eopNSt = bopNSt +OAt DMt eopIPt
= bopIPt
DMt

Note that end-of-period inventories are observed after demand and any shipment but
before a replenishment order is placed. This is in particular essential for understanding eopIP.

symbol

description

formula (in Period t )

DS

amount of incoming demand served from the shelf

DU
OH

amount of incoming demand not served from the shelf amount of


stock on hand (physical stock) at end of period

DMt DSt OHt =


max(0,eopNSt )

BL

amount of backlog carried at end of period

BLt =

min(DMt ,max(0,bopNSt +OAt ))

min(0,eopNSt )

Performance calculations in a period The following data are kept in performance records

The supply system


ThesupplysystemismodeledasaconveyorbeltwithL+1positionsnumbered0,1, ,L as in Figure 5.
direction of movement of belt

2
3
4
Figure 5: Supply as a conveyor belt.

The numbers below the belt are the positions of slots of the belt while the the numbers
inside the slots of the belt are the volumes on order. More specifically, when observing the
belt at the beginning of a Period t , an amount ofAat position x means that
thisamountisdueforreceptioninPeriod t +x. ThusfortheexampleshowninFigure5 the amount of
7 (at Position 0) is due right now.
Right before issuing a replenishment order the belt moves one position (the amount at
position x moves to position x 1, discarding9 any amount at position 0). So we now have the
belt configuration given in Figure 6, putting an amount of 0 for the last position.
direction of movement of belt

We have taken off the amount at the beginning of the period.

19

APPENDICES

Figure 6: Supply as a conveyor belt after having moved one position.


Nextanorderisplaced,sayofsize13,andplacedonthebeltatpositionL= 6. Thisresults in the belt
configuration given in Figure 7 at the end of Period t and the beginning of Period t +1.
direction of movement of belt

13

0
1
2
3
4
5
6
Figure 7: Supply as a conveyor belt after having placed an order of size 13.
In the R-script the supply system is modeled in the variable SupplyChannel which is defined10
as

SupplyChannel=rep(0,nominallt+1) .
Values found under Subpart A
NotethatyoumayhavetosetappropriatevaluesintheRscriptforproducingthebelow results.
FR = 90% under broad demand
avDem

sigDem

FR

OH

Normal approximation
5.9100
discrete demand (sim)
5.9140
FR = 99% under broad demand

4.2014
4.1804

0.9000
0.8869

27.4903
27.4903

12.7153
10.6092

avDem

sigDem

FR

OH

Normal approximation
5.9100
discrete demand (sim)
5.9425
FR = 90% under narrow demand

4.2014
4.2692

0.9900
0.9849

37.4268
37.4268

22.6518
19.7818

avDem

sigDem

FR

OH

Normal approximation
1.5500
discrete demand (sim)
1.5405
FR = 99% under narrow demand

1.2835
1.2764

0.9000
0.8910

7.6267
7.6267

3.7517
3.3482

Normal approximation
discrete demand (sim)

10

avDem

sigDem

FR

OH

1.5500
1.5665

1.2835
1.2779

0.9900
0.9867

10.5741
10.5741

6.6991
6.0109

The R-function rep repeats the first argument for the second argument times. So, for example, rep(0,7) would repeat
the value 0 for 7 times and the supply channel is empty.

20

APPENDICES

Appendix to Part B
The tandem system works essentially with two copies of an inventory system where time is
once more organized per row. We only have to make sure that the two inventory installations
get properly connected:
orders placed by Installation 1 arrive as demand to be met (without delay if possible) at
Installation 2 ,
shipments made by Installation 2 arrive, after lead time L1, as order receipts at Installation 1.

Appendix to Part D
Themainscripttobeusedis12ManyBeDiIndi. ThisscriptusesthescriptGetIntersectionOfTwo as this script
holds a function that computes intersection points. The assumed set-up for computing intersections is as
follows.
We assume a data frame with three columns. The first column hold values for an
xcoordinate whereas the second and third column have a y -coordinate, let us say y 1 in the
second column and y 2 in the third column. It is assumed that the pairs (x, y 1) are points on
the graph of a function and that (x, y 2) are points on the graph of another function.
The function GetIntersectingValues in GetIntersectionOfTwo now produces (estimates)
the intersection points of the graphs of the two series of points taken from the functions.

Вам также может понравиться