Академический Документы
Профессиональный Документы
Культура Документы
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.
FR =0.99
demand=narrow demand=broad
4
FR
Av. OH
normal approx.
.90
??
??
??
??
??
and
FR
Av. OH
normal approx.
.99
??
??
??
??
??
(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;
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)
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.
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
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
ns
1200
2
18
810,000
1/8
270
2
cd
cs
cs0
ci
cr
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
vmax
capacity of a truck
0.6
8,000
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
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
case
drop number of
size stops item
q
ns
load
frequency
traveleditem
v
L
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.
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.
s(1)
s(1)
ns
ns
kp
(0) ns(0) +
q(0)ns(0)! +t
q(0)
s(0) s
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).
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 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.
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
16
APPENDICES
1. ApplythedefinitionsFromTable5onecomputestheaverage(mean)throughtheory
as
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.
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.
symbol
description
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
SH
eopNS
eopIP
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
DS
DU
OH
BL
BLt =
min(0,eopNSt )
Performance calculations in a period The following data are kept in performance records
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
19
APPENDICES
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.