thingies
This commit is contained in:
parent
a67287eeb7
commit
ee8dd41f85
129 changed files with 91712 additions and 0 deletions
2256
pds/cases/case_1/case1_student_notebook.ipynb
Normal file
2256
pds/cases/case_1/case1_student_notebook.ipynb
Normal file
File diff suppressed because one or more lines are too long
BIN
pds/cases/case_1/case_1.zip
Normal file
BIN
pds/cases/case_1/case_1.zip
Normal file
Binary file not shown.
BIN
pds/cases/case_1/case_1_description.docx
Normal file
BIN
pds/cases/case_1/case_1_description.docx
Normal file
Binary file not shown.
196
pds/cases/case_1/case_1_description.md
Normal file
196
pds/cases/case_1/case_1_description.md
Normal file
|
|
@ -0,0 +1,196 @@
|
|||
# Case 1: Simulating Stock Policies
|
||||
|
||||
- Title: Choosing stock policies under uncertainty
|
||||
- Description: Students role-play their participation as consultants in a
|
||||
project for Beanie Limited, a coffee beans roasting company. Elisa, the
|
||||
regional manager for the italian region, is not happy with their inventory
|
||||
policies for raw beans. The students are asked to analyse the problems posed
|
||||
by Elisa and apply simulation techniques, together with real data, to
|
||||
recommend a stock policy for the company's warehouse in the italian region.
|
||||
Python notebooks with some helpful prepared functions are provided to the
|
||||
students. The final delivery is a report with their recommendation to the
|
||||
client company, along with the used code.
|
||||
|
||||
Stuff I want them to understand:
|
||||
|
||||
- The model/hypothesis/validate
|
||||
- That in a simulation you set parameters, and you observe results
|
||||
- To write in a problem-solving manner.
|
||||
- That there are trade-offs and it's not trivial to find optimal solutions.
|
||||
|
||||
Elements of the simulation:
|
||||
|
||||
- Demand behavior
|
||||
- Lead time and standard deviation of provider (or providers)
|
||||
- Service level
|
||||
- Punishment for sales lost
|
||||
|
||||
Observable effects of policies:
|
||||
|
||||
- Mean inventory at hand
|
||||
- Service level
|
||||
- Warehousing/Capital Cost
|
||||
- Lost sales cost
|
||||
|
||||
# Case 1: Choosing ordering goods under uncertainty
|
||||
|
||||
You are part of an expert simulation team in SimiUPF SL. You have been assigned
|
||||
to a new project with a client company, Beanie Limited. Beanie Limited is a
|
||||
coffee roasting company and also distributes raw coffee beans through Europe
|
||||
and Middle East.
|
||||
|
||||
Specifically, you will be working for Elisa Bolzano, the Director of Beanie
|
||||
Limited's warehouse located in Caserta, near Naples. Elisa is the full
|
||||
responsible for all the operations in the warehouse. She has requested the help
|
||||
of the SimiUPF team because she is worried about how certain things are managed
|
||||
in the warehouse and wants your help.
|
||||
|
||||
The Caserta warehouse serves the raw coffee beans distribution business of
|
||||
Beanie Limited in southern europe and the mediterranean. The warehouse and its
|
||||
team are responsible for serving clients and also other smaller regional
|
||||
warehouses from Beanie Limited in this geography. From the warehouse point of
|
||||
view, they are usually just called "the clients". Whenever one of the clients
|
||||
needs raw beans, they arrange a transport truck that goes to the warehouse to
|
||||
pick up a certain amount of goods. Elisa's team fills up the truck with the
|
||||
requested goods, and then the clients take care of receiving that at their own
|
||||
locations. Given the size and relevance of the Caserta warehouse, activity is
|
||||
pretty much constant, with goods leaving the warehouse towards client locations
|
||||
every day.
|
||||
|
||||
The Caserta warehouse itself has only one way to source coffee beans to store
|
||||
in their warehouse: requesting them to the Beanie Limited central offices in
|
||||
Diemen, near Amsterdam. Whenever Elisa's team considers that more stock is
|
||||
needed, they post a Purchase Order to the central office for a certain amount
|
||||
of beans. The central office arranges the goods and the delivery and, after a
|
||||
few days, the goods reach Caserta and are stored in the warehouse. The central
|
||||
office tries to ensure a lead time of 7 days (lead time is the time that passes
|
||||
between an order being placed and the goods reaching their destination), but
|
||||
the reality is they do what they can and this time is not always respected.
|
||||
|
||||
Stock is a necessary evil (it implies a lot of cost), but Elisa's warehouse
|
||||
needs it to serve the clients in their region properly. Having too little stock
|
||||
means the clients need to wait long times to get their goods, which is risky
|
||||
for the business. On the other hand, having a lot of stock means high warehouse
|
||||
costs and financial opportunity cost (if Beanie Limited has 1 million € in
|
||||
coffee beans in a warehouse, that is 1 million € they can't invest somewhere
|
||||
else to improve their business). Thus, Elisa needs the stock to be as small as
|
||||
possible, while making sure she is not disappointing clients at the same time
|
||||
because of stockouts.
|
||||
|
||||
Elisa is calling you because 2021 was a terrible year for the warehouse. The
|
||||
year was a chaotic one, and Elisa's team was not able to run operations
|
||||
smoothly. Although Elisa is not providing exact numbers, she is very well aware
|
||||
that the warehouse stock was unnecessarily high at times, and that there were
|
||||
too many periods where the warehouse was out of stock and clients had to wait
|
||||
to get their goods.
|
||||
|
||||
Elisa thinks the main reason for this is the lack of a clear policy for when to
|
||||
order and how much to order from Diemen. Her team decides independently when to
|
||||
do it, and Elisa has a feeling that they are not approaching these decisions
|
||||
the right way. This means that sometimes they order when there is no need to,
|
||||
sometimes they don't order when they should, and that the amounts being ordered
|
||||
might not always be the optimal ones.
|
||||
|
||||
Here is where you come in. As simulation experts, Elisa expects from you that
|
||||
you can help design an ordering policy to fix these issues. Doing this implies
|
||||
examining data from last year, building a proper simulation to examine the
|
||||
different factors being involved, and deciding when and how should Elisa's team
|
||||
order more goods from Diemen.
|
||||
|
||||
Elisa expects a report where you share your findings and recommendations in a
|
||||
clear way that can help her team. Also, Elisa does not trust you blindly: you
|
||||
need to motivate the reasoning behind your recommendations. Otherwise, she will
|
||||
not feel comfortable implementing your recommendations and the bosses at
|
||||
SimiUPF will be mad at you...
|
||||
|
||||
## Detailed task definition
|
||||
|
||||
- Below you will find four levels of questions. Levels 1 to 3 are compulsory.
|
||||
Level 4 is optional.
|
||||
- You need to write a report document where you answer the questions of the
|
||||
different levels. This report should be directed towards Elisa, should give
|
||||
her clear recommendations and should justify these recommendations. It's
|
||||
important for you to reflect your methodology to back your proposals.
|
||||
- Each level is worth 2 points out of a total of 10. The 2 missing points will
|
||||
grade the clarity and structure of your report and code.
|
||||
- You need to use a Python notebook to solve all levels. A helper notebook is
|
||||
provided. Please attach a notebook that shows your
|
||||
solution/proposal/analysis.
|
||||
- Include your team number, names and student IDs in all your deliverables.
|
||||
|
||||
## Data
|
||||
|
||||
- You are provided with three tables that contain real data from 2021.
|
||||
- demand_events: this table shows how many beans left the Caserta warehouse
|
||||
to serve clients. There is some amount leaving every day because the
|
||||
warehouse serves many small orders from small clients, so there is always
|
||||
some order being fulfilled. The amount is measured in kilograms, and
|
||||
represents the total amount that left during that day. Individual orders
|
||||
are not relevant for this case, so we only look at daily total figures.
|
||||
- sourcing_events: this table shows the Purchase Orders that Elisa's team
|
||||
placed to Diemen. For each order, there are two dates: the date when
|
||||
Elisa's team placed the order, and the date where the beans actually
|
||||
reached the Caserta warehouse. The difference between those dates is the
|
||||
real lead time of each order. The amount is measured in kilograms.
|
||||
- stock_state: this table shows the stock at the warehouse at the end of
|
||||
each date. As you can guess, the stock for a certain date is the stock of
|
||||
the previous day, plus the goods that reached Caserta coming from Diemen,
|
||||
minus the goods that left the warehouse to serve client orders. A
|
||||
negative stock is not a challenge to the laws of physics: it means
|
||||
clients are waiting for their requested beans. If one row shows -1.000,
|
||||
it means that the warehouse is empty, and clients are awaiting a total
|
||||
amount of 1.000 kgs of beans. If next morning, a 1.000 kgs reach Caserta
|
||||
from Diemen, those will be used immediately to satisfy those awaiting
|
||||
clients, and the warehouse stock will become 0.
|
||||
|
||||
## Notebook
|
||||
|
||||
A notebook with some helping code has been provided. The code contains a small
|
||||
simulation engine that can help you simulate a year of activity for the
|
||||
warehouse. The instructions on how to use the code are in the notebook itself.
|
||||
|
||||
## Levels
|
||||
|
||||
- Level 1
|
||||
- Elisa wants you to measure the performance of the last year, providing
|
||||
quantitative metrics. She knows it was a bad year, but hasn't looked at
|
||||
the real data to summarize how bad it was. Remember that there is a
|
||||
trade-off: too much stock, is not desired, but running out of stock and
|
||||
making clients wait is also negative.
|
||||
- Going one step further, Elisa wants to know: what was done wrong?
|
||||
- Level 2
|
||||
- Elisa wants you to propose an ordering policy. This means, that you need
|
||||
to define a rule that, once each day, should answer the questions: should
|
||||
we place a Purchase Order to request beans from Diemen today? If yes, how
|
||||
much should we order?
|
||||
- Use simulation to present metrics on what is the expected performance
|
||||
with the policy you are proposing. Remember, you need to convince Elisa
|
||||
that this is better than what happens today.
|
||||
- As a specific constraint, Elisa explains that she wants that the
|
||||
probability of a stockout to be at most of 5% on any given day.
|
||||
|
||||
- Level 3
|
||||
- Right after you finished designing your policy for level 2, Elisa called
|
||||
with some news: she has just been informed by the management in Diemen
|
||||
that a new Minimum Order Quantity (MOQ) rule will begin soon. This rule
|
||||
means that, when the Caserta warehouse places an order to request
|
||||
material from Diemen, the order should be of at least 500,000 kgs of
|
||||
beans, and not less than that.
|
||||
- Elisa wants you to take this into account. Does it affect the policy you
|
||||
proposed for level 2? If so, you need to come up with a new one that
|
||||
adapts to this rule and compare it to the previous one.
|
||||
- Level 4
|
||||
- Elisa briefly discussed with you in one meeting that there is an option
|
||||
to come to an agreement with the team in Diemen to improve the lead time
|
||||
stability. The proposal from Diemen is that, if the target lead time was
|
||||
set to something higher that the current 7 days target, providing a more
|
||||
stable delivery would be feasible.
|
||||
- The specific proposal from Diemen is: if the lead time target is changed
|
||||
to 15 days, they provide a 100% guarantee that orders will be delivered
|
||||
in exactly 15 days.
|
||||
- Elisa would love if you could take some additional time to study this
|
||||
proposal. What is better for Caserta? The current 7 days target
|
||||
lead-time, with unstable delivery times? Or a fixed, 15-day lead time?
|
||||
- The MOQ rule of level 3 still applies.
|
||||
|
||||
|
||||
BIN
pds/cases/case_1/case_1_description.pdf
Normal file
BIN
pds/cases/case_1/case_1_description.pdf
Normal file
Binary file not shown.
366
pds/cases/case_1/demand_events.csv
Normal file
366
pds/cases/case_1/demand_events.csv
Normal file
|
|
@ -0,0 +1,366 @@
|
|||
date,demand_quantity
|
||||
2021-01-01,54609.49281314914
|
||||
2021-01-02,36208.63648649295
|
||||
2021-01-03,77784.17276763407
|
||||
2021-01-04,76481.81360421646
|
||||
2021-01-05,52305.87658918292
|
||||
2021-01-06,57098.56436860317
|
||||
2021-01-07,41565.68706138541
|
||||
2021-01-08,81995.500619844
|
||||
2021-01-09,71041.91466404148
|
||||
2021-01-10,31787.17080818402
|
||||
2021-01-11,32735.09633866546
|
||||
2021-01-12,32855.44553254065
|
||||
2021-01-13,55420.934082626205
|
||||
2021-01-14,48883.311263507494
|
||||
2021-01-15,48368.597773147136
|
||||
2021-01-16,40225.99478591274
|
||||
2021-01-17,69003.66723779934
|
||||
2021-01-18,67378.93368511106
|
||||
2021-01-19,59444.432628854185
|
||||
2021-01-20,54441.80415596864
|
||||
2021-01-21,52796.814721541414
|
||||
2021-01-22,30193.150803735854
|
||||
2021-01-23,62328.53756562836
|
||||
2021-01-24,43690.320158519615
|
||||
2021-01-25,78451.89473980921
|
||||
2021-01-26,47794.13927746792
|
||||
2021-01-27,51454.93947489077
|
||||
2021-01-28,64633.17690683539
|
||||
2021-01-29,67371.66310250101
|
||||
2021-01-30,51137.068372905895
|
||||
2021-01-31,62192.931782584405
|
||||
2021-02-01,62381.245234820446
|
||||
2021-02-02,62744.03145531537
|
||||
2021-02-03,51305.706023572566
|
||||
2021-02-04,52618.66719247759
|
||||
2021-02-05,51961.10865929137
|
||||
2021-02-06,55154.27434352692
|
||||
2021-02-07,39799.62917632264
|
||||
2021-02-08,65486.97890826721
|
||||
2021-02-09,55355.23228947571
|
||||
2021-02-10,46211.4777291026
|
||||
2021-02-11,53132.95392507133
|
||||
2021-02-12,31537.03525349067
|
||||
2021-02-13,46447.72089889987
|
||||
2021-02-14,63731.03176553111
|
||||
2021-02-15,54454.77009849779
|
||||
2021-02-16,40659.50720269109
|
||||
2021-02-17,63493.99813149876
|
||||
2021-02-18,54931.266644895266
|
||||
2021-02-19,28278.734877540137
|
||||
2021-02-20,36379.638867181835
|
||||
2021-02-21,62202.758260545044
|
||||
2021-02-22,54523.210135004185
|
||||
2021-02-23,42395.85236943305
|
||||
2021-02-24,42934.425415725156
|
||||
2021-02-25,51494.77047631462
|
||||
2021-02-26,44220.2960470736
|
||||
2021-02-27,45670.120416197926
|
||||
2021-02-28,57107.49381367681
|
||||
2021-03-01,28972.234058115788
|
||||
2021-03-02,43048.734607813065
|
||||
2021-03-03,41505.53405595842
|
||||
2021-03-04,47926.03548243223
|
||||
2021-03-05,61278.99549030161
|
||||
2021-03-06,39044.50052424295
|
||||
2021-03-07,37142.63665375576
|
||||
2021-03-08,59385.01021647509
|
||||
2021-03-09,19622.861200135892
|
||||
2021-03-10,42875.82033258566
|
||||
2021-03-11,37298.094228973925
|
||||
2021-03-12,53411.899019061944
|
||||
2021-03-13,45345.99865109816
|
||||
2021-03-14,53211.40616195306
|
||||
2021-03-15,40974.40081655905
|
||||
2021-03-16,56025.67583148412
|
||||
2021-03-17,42957.88421097572
|
||||
2021-03-18,65464.99283743926
|
||||
2021-03-19,28628.77720679815
|
||||
2021-03-20,50873.13077669
|
||||
2021-03-21,47215.115350042746
|
||||
2021-03-22,44982.481462385775
|
||||
2021-03-23,72845.44784612038
|
||||
2021-03-24,36657.28355561715
|
||||
2021-03-25,35932.62440127316
|
||||
2021-03-26,90802.53749884429
|
||||
2021-03-27,54150.36198995029
|
||||
2021-03-28,57725.715294590715
|
||||
2021-03-29,49797.541628930994
|
||||
2021-03-30,39842.574327318325
|
||||
2021-03-31,46648.05822011224
|
||||
2021-04-01,38251.20061495644
|
||||
2021-04-02,54968.95147105346
|
||||
2021-04-03,39223.33668121346
|
||||
2021-04-04,55196.72314245463
|
||||
2021-04-05,60193.96623402014
|
||||
2021-04-06,107790.97235982082
|
||||
2021-04-07,58927.3553815537
|
||||
2021-04-08,52570.524217849554
|
||||
2021-04-09,40996.74684261808
|
||||
2021-04-10,52952.91853803685
|
||||
2021-04-11,55117.279622249654
|
||||
2021-04-12,62330.90239991735
|
||||
2021-04-13,60352.159875666686
|
||||
2021-04-14,46481.1929993728
|
||||
2021-04-15,26740.04853400801
|
||||
2021-04-16,58824.75809726865
|
||||
2021-04-17,48919.848176294996
|
||||
2021-04-18,69164.97343682637
|
||||
2021-04-19,65052.99346838036
|
||||
2021-04-20,86948.6316872793
|
||||
2021-04-21,47600.922050548594
|
||||
2021-04-22,53629.43407349051
|
||||
2021-04-23,58802.85640700405
|
||||
2021-04-24,27277.291629712032
|
||||
2021-04-25,72991.08369503866
|
||||
2021-04-26,46319.17825995694
|
||||
2021-04-27,42473.64434623195
|
||||
2021-04-28,62986.327912551824
|
||||
2021-04-29,59770.868769586974
|
||||
2021-04-30,46967.110213491585
|
||||
2021-05-01,31283.252270527257
|
||||
2021-05-02,45270.96133039481
|
||||
2021-05-03,40200.06151139432
|
||||
2021-05-04,28769.438869243786
|
||||
2021-05-05,41597.284397045456
|
||||
2021-05-06,42053.59694349442
|
||||
2021-05-07,32056.90063878994
|
||||
2021-05-08,24126.23251230451
|
||||
2021-05-09,61874.94040944404
|
||||
2021-05-10,69582.18210731493
|
||||
2021-05-11,54713.709988929106
|
||||
2021-05-12,77986.61766717135
|
||||
2021-05-13,51047.031274850284
|
||||
2021-05-14,59715.32807151039
|
||||
2021-05-15,73688.19223261088
|
||||
2021-05-16,65807.03078052355
|
||||
2021-05-17,55779.76069593255
|
||||
2021-05-18,53655.30817237868
|
||||
2021-05-19,53863.25586084147
|
||||
2021-05-20,42447.86518825701
|
||||
2021-05-21,34634.185379985654
|
||||
2021-05-22,81385.8091352819
|
||||
2021-05-23,53674.49856663084
|
||||
2021-05-24,32130.44754196027
|
||||
2021-05-25,35141.955123039676
|
||||
2021-05-26,35379.77494659018
|
||||
2021-05-27,47723.22357446625
|
||||
2021-05-28,50903.4531491154
|
||||
2021-05-29,52597.71388776773
|
||||
2021-05-30,37762.845725518426
|
||||
2021-05-31,31687.345250434668
|
||||
2021-06-01,1380.9898989639114
|
||||
2021-06-02,39384.958015718286
|
||||
2021-06-03,62407.74873554036
|
||||
2021-06-04,65856.83339328374
|
||||
2021-06-05,41159.52864583683
|
||||
2021-06-06,78292.78851815795
|
||||
2021-06-07,45085.067801033474
|
||||
2021-06-08,63969.20178674298
|
||||
2021-06-09,61865.47920564571
|
||||
2021-06-10,66481.65277980786
|
||||
2021-06-11,51663.83884564799
|
||||
2021-06-12,49462.60941335073
|
||||
2021-06-13,48907.56631014691
|
||||
2021-06-14,27822.17014448859
|
||||
2021-06-15,35277.37023428074
|
||||
2021-06-16,58563.35766039751
|
||||
2021-06-17,62202.644540009576
|
||||
2021-06-18,59361.79725578232
|
||||
2021-06-19,37617.54204811233
|
||||
2021-06-20,84719.87850010264
|
||||
2021-06-21,50153.4959152938
|
||||
2021-06-22,40323.203680923136
|
||||
2021-06-23,34962.05953043287
|
||||
2021-06-24,46613.355492701965
|
||||
2021-06-25,53246.878843729624
|
||||
2021-06-26,38693.95753463766
|
||||
2021-06-27,64529.674857993334
|
||||
2021-06-28,41126.42916746255
|
||||
2021-06-29,71984.7315338233
|
||||
2021-06-30,28888.043384351673
|
||||
2021-07-01,60293.9028556177
|
||||
2021-07-02,49816.29840729628
|
||||
2021-07-03,42812.38643232065
|
||||
2021-07-04,34909.73927750447
|
||||
2021-07-05,37591.53584671515
|
||||
2021-07-06,39469.203591839716
|
||||
2021-07-07,54396.08709948022
|
||||
2021-07-08,28047.275778018222
|
||||
2021-07-09,41834.25913212226
|
||||
2021-07-10,42604.985980117504
|
||||
2021-07-11,57706.78926368313
|
||||
2021-07-12,37965.84096167571
|
||||
2021-07-13,42719.54678256345
|
||||
2021-07-14,36541.18442771253
|
||||
2021-07-15,45179.2123752051
|
||||
2021-07-16,49107.119659072996
|
||||
2021-07-17,28547.87933059051
|
||||
2021-07-18,49714.75688145967
|
||||
2021-07-19,33936.612529083315
|
||||
2021-07-20,72130.34325424329
|
||||
2021-07-21,21218.431770514377
|
||||
2021-07-22,47114.58552828316
|
||||
2021-07-23,62864.89434803029
|
||||
2021-07-24,48265.27576417639
|
||||
2021-07-25,82856.83438714968
|
||||
2021-07-26,71619.09933599173
|
||||
2021-07-27,31313.91831932018
|
||||
2021-07-28,51702.76017876872
|
||||
2021-07-29,51759.91074963173
|
||||
2021-07-30,43399.332699545244
|
||||
2021-07-31,55424.54037571451
|
||||
2021-08-01,42225.94672589529
|
||||
2021-08-02,34807.53319498364
|
||||
2021-08-03,73469.6548372101
|
||||
2021-08-04,27209.4505106898
|
||||
2021-08-05,57237.08622864778
|
||||
2021-08-06,45169.07725691487
|
||||
2021-08-07,51028.44462209041
|
||||
2021-08-08,40990.419651217926
|
||||
2021-08-09,31432.767517597265
|
||||
2021-08-10,46704.92168243732
|
||||
2021-08-11,67447.45628232439
|
||||
2021-08-12,56060.762852218075
|
||||
2021-08-13,36096.04292632875
|
||||
2021-08-14,82159.16133987988
|
||||
2021-08-15,61384.53830739901
|
||||
2021-08-16,42921.0220131585
|
||||
2021-08-17,57574.80918470686
|
||||
2021-08-18,44223.76579375525
|
||||
2021-08-19,38112.188923509486
|
||||
2021-08-20,43302.275718994686
|
||||
2021-08-21,31995.553894163357
|
||||
2021-08-22,51456.16324022061
|
||||
2021-08-23,51376.41164803253
|
||||
2021-08-24,45624.593753100846
|
||||
2021-08-25,46734.78195159169
|
||||
2021-08-26,37565.07483616892
|
||||
2021-08-27,23554.39766955899
|
||||
2021-08-28,20604.948141803365
|
||||
2021-08-29,66334.25895451049
|
||||
2021-08-30,48047.85418448473
|
||||
2021-08-31,56191.71390404747
|
||||
2021-09-01,44859.282252098456
|
||||
2021-09-02,46030.147501430656
|
||||
2021-09-03,10703.823438653832
|
||||
2021-09-04,70343.60042856235
|
||||
2021-09-05,69607.14131423642
|
||||
2021-09-06,56931.55211394906
|
||||
2021-09-07,54663.61348397007
|
||||
2021-09-08,57725.529008129895
|
||||
2021-09-09,53757.39275518815
|
||||
2021-09-10,53480.74906036454
|
||||
2021-09-11,49602.291868261746
|
||||
2021-09-12,52985.895433602054
|
||||
2021-09-13,37411.73715166042
|
||||
2021-09-14,59155.55398150197
|
||||
2021-09-15,21991.02211112378
|
||||
2021-09-16,59508.78533477017
|
||||
2021-09-17,41544.13170794038
|
||||
2021-09-18,46878.16624464087
|
||||
2021-09-19,32469.82943570702
|
||||
2021-09-20,61806.26905613678
|
||||
2021-09-21,56074.725664414334
|
||||
2021-09-22,53483.80545741505
|
||||
2021-09-23,30077.209266523543
|
||||
2021-09-24,73070.54849698953
|
||||
2021-09-25,44118.377703017635
|
||||
2021-09-26,34134.3360656615
|
||||
2021-09-27,61619.510801440054
|
||||
2021-09-28,29334.959480643633
|
||||
2021-09-29,54840.778405071345
|
||||
2021-09-30,54861.25954092192
|
||||
2021-10-01,37666.69406650353
|
||||
2021-10-02,45514.88974301199
|
||||
2021-10-03,37872.595956602185
|
||||
2021-10-04,54862.49528732663
|
||||
2021-10-05,72168.41067112274
|
||||
2021-10-06,58411.76789552352
|
||||
2021-10-07,64450.64193866483
|
||||
2021-10-08,39846.169995410615
|
||||
2021-10-09,51012.92307031886
|
||||
2021-10-10,56193.97181413436
|
||||
2021-10-11,34065.44429410843
|
||||
2021-10-12,58206.460717550566
|
||||
2021-10-13,46487.945645762295
|
||||
2021-10-14,50076.70184963691
|
||||
2021-10-15,47580.71432500986
|
||||
2021-10-16,53915.82908269834
|
||||
2021-10-17,39606.35607109019
|
||||
2021-10-18,73790.25224218029
|
||||
2021-10-19,38407.621781936425
|
||||
2021-10-20,33404.97538990958
|
||||
2021-10-21,59931.9601178157
|
||||
2021-10-22,74486.16955897454
|
||||
2021-10-23,50195.02837816861
|
||||
2021-10-24,40073.20302847418
|
||||
2021-10-25,64626.796001266266
|
||||
2021-10-26,61727.34307665966
|
||||
2021-10-27,62187.88733591297
|
||||
2021-10-28,54214.87801602549
|
||||
2021-10-29,67142.34221772531
|
||||
2021-10-30,46487.69937914996
|
||||
2021-10-31,31086.740684974324
|
||||
2021-11-01,48278.95337799651
|
||||
2021-11-02,20718.68300716247
|
||||
2021-11-03,58138.40065378947
|
||||
2021-11-04,49722.30296011415
|
||||
2021-11-05,36742.138456983004
|
||||
2021-11-06,42736.48890700623
|
||||
2021-11-07,55356.6885726762
|
||||
2021-11-08,81832.3429551895
|
||||
2021-11-09,62338.173681547836
|
||||
2021-11-10,39202.33687407937
|
||||
2021-11-11,62786.50002194336
|
||||
2021-11-12,37726.689751497914
|
||||
2021-11-13,67033.48460270898
|
||||
2021-11-14,55366.81040522425
|
||||
2021-11-15,53898.24191372635
|
||||
2021-11-16,62845.981914852084
|
||||
2021-11-17,33833.82833106041
|
||||
2021-11-18,61076.99869993116
|
||||
2021-11-19,51228.112090794835
|
||||
2021-11-20,55635.47027518508
|
||||
2021-11-21,71803.01115735975
|
||||
2021-11-22,50315.05762449138
|
||||
2021-11-23,60710.007411381375
|
||||
2021-11-24,73249.01607526309
|
||||
2021-11-25,57699.01149670034
|
||||
2021-11-26,46798.292724322295
|
||||
2021-11-27,36359.18817807891
|
||||
2021-11-28,61511.52093729363
|
||||
2021-11-29,39284.72872960448
|
||||
2021-11-30,28462.06773230841
|
||||
2021-12-01,25809.261932155227
|
||||
2021-12-02,59425.1826389642
|
||||
2021-12-03,43014.05369644615
|
||||
2021-12-04,52769.507877984564
|
||||
2021-12-05,56657.291422193426
|
||||
2021-12-06,59175.14433261302
|
||||
2021-12-07,57450.71229516849
|
||||
2021-12-08,25887.75148158159
|
||||
2021-12-09,21300.79633013303
|
||||
2021-12-10,49686.47609053778
|
||||
2021-12-11,50683.5775985572
|
||||
2021-12-12,43090.41843560319
|
||||
2021-12-13,28815.44447997063
|
||||
2021-12-14,31445.73933682877
|
||||
2021-12-15,50964.200286431944
|
||||
2021-12-16,37689.76522472434
|
||||
2021-12-17,39270.444361100475
|
||||
2021-12-18,63767.92920582164
|
||||
2021-12-19,66245.76864762916
|
||||
2021-12-20,64310.02645239804
|
||||
2021-12-21,20186.46628098661
|
||||
2021-12-22,57829.12348425346
|
||||
2021-12-23,61209.40407684893
|
||||
2021-12-24,60229.294569424455
|
||||
2021-12-25,57790.197713617585
|
||||
2021-12-26,59848.30412950744
|
||||
2021-12-27,48843.47435878844
|
||||
2021-12-28,45483.444566160666
|
||||
2021-12-29,45361.81436223178
|
||||
2021-12-30,57103.88645952773
|
||||
2021-12-31,49479.32345442135
|
||||
|
BIN
pds/cases/case_1/grading.xlsx
Normal file
BIN
pds/cases/case_1/grading.xlsx
Normal file
Binary file not shown.
BIN
pds/cases/case_1/grading_team_1.xlsx
Normal file
BIN
pds/cases/case_1/grading_team_1.xlsx
Normal file
Binary file not shown.
BIN
pds/cases/case_1/grading_team_2.xlsx
Normal file
BIN
pds/cases/case_1/grading_team_2.xlsx
Normal file
Binary file not shown.
BIN
pds/cases/case_1/grading_team_3.xlsx
Normal file
BIN
pds/cases/case_1/grading_team_3.xlsx
Normal file
Binary file not shown.
BIN
pds/cases/case_1/grading_team_4.xlsx
Normal file
BIN
pds/cases/case_1/grading_team_4.xlsx
Normal file
Binary file not shown.
BIN
pds/cases/case_1/grading_team_5.xlsx
Normal file
BIN
pds/cases/case_1/grading_team_5.xlsx
Normal file
Binary file not shown.
61
pds/cases/case_1/sourcing_events.csv
Normal file
61
pds/cases/case_1/sourcing_events.csv
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
request_date,delivery_date,amount
|
||||
2021-06-18,2021-06-24,361622.08421162824
|
||||
2021-04-08,2021-04-17,404943.20818378055
|
||||
2021-08-02,2021-08-10,372079.3749313439
|
||||
2021-03-23,2021-03-28,324410.8683704191
|
||||
2021-07-14,2021-07-19,467167.83305448893
|
||||
2021-03-02,2021-03-09,280731.9688885999
|
||||
2021-07-18,2021-07-26,369123.2301230304
|
||||
2021-02-18,2021-02-27,384645.34262920194
|
||||
2021-01-21,2021-01-25,310407.1921732673
|
||||
2021-08-12,2021-08-21,366174.22830054327
|
||||
2021-11-02,2021-11-09,391623.2685507731
|
||||
2021-07-13,2021-07-21,345458.2161390513
|
||||
2021-06-01,2021-06-10,360467.175317622
|
||||
2021-10-20,2021-10-31,336289.0502818366
|
||||
2021-07-21,2021-07-29,381876.17957110034
|
||||
2021-10-06,2021-10-11,314261.8504829489
|
||||
2021-11-15,2021-11-22,308806.6478588278
|
||||
2021-09-05,2021-09-14,330698.694265319
|
||||
2021-12-26,2022-01-04,407311.3676167535
|
||||
2021-01-16,2021-01-25,214247.55937424488
|
||||
2021-04-20,2021-04-26,269445.2778637154
|
||||
2021-01-22,2021-01-27,479246.85314207803
|
||||
2021-02-02,2021-02-11,347470.77377278876
|
||||
2021-11-26,2021-12-01,302533.4097257286
|
||||
2021-08-23,2021-09-01,381700.4232063111
|
||||
2021-03-31,2021-04-09,277635.5674830633
|
||||
2021-06-03,2021-06-10,190836.06099482052
|
||||
2021-06-30,2021-07-07,352714.6964695578
|
||||
2021-08-10,2021-08-18,281208.5043011291
|
||||
2021-08-04,2021-08-10,336022.8514088414
|
||||
2021-01-05,2021-01-10,351041.68228418275
|
||||
2021-04-29,2021-05-06,338705.4533610672
|
||||
2021-06-14,2021-06-22,216774.79936204778
|
||||
2021-06-21,2021-07-01,331075.5096480785
|
||||
2021-12-01,2021-12-07,358629.8535678753
|
||||
2021-12-13,2021-12-23,237124.0787089357
|
||||
2021-12-17,2021-12-22,229278.15299078176
|
||||
2021-10-17,2021-10-22,258928.96346443848
|
||||
2021-11-28,2021-12-05,378532.9798112182
|
||||
2021-06-10,2021-06-16,197717.59182534326
|
||||
2021-02-22,2021-02-27,384000.6974037471
|
||||
2021-11-30,2021-12-11,355168.6944729242
|
||||
2021-02-03,2021-02-10,312383.0537738918
|
||||
2021-04-13,2021-04-25,231816.99643375044
|
||||
2021-06-07,2021-06-13,276881.9915723157
|
||||
2021-12-03,2021-12-07,380847.56715868326
|
||||
2021-11-29,2021-12-09,412123.5063860729
|
||||
2021-03-29,2021-04-04,261409.7021051771
|
||||
2021-01-28,2021-02-05,404557.69495151856
|
||||
2021-07-04,2021-07-09,374522.25600175356
|
||||
2021-01-13,2021-01-20,328894.06129062787
|
||||
2021-09-29,2021-10-04,280742.72595198866
|
||||
2021-10-18,2021-10-25,291048.90802077635
|
||||
2021-04-09,2021-04-16,449418.2981764818
|
||||
2021-04-14,2021-04-22,341098.18303366995
|
||||
2021-05-08,2021-05-17,416941.3633993643
|
||||
2021-05-19,2021-05-27,345255.5746514472
|
||||
2021-07-26,2021-08-03,299525.71274023474
|
||||
2021-10-24,2021-10-31,367817.7882031555
|
||||
2021-01-14,2021-01-21,471478.60787775513
|
||||
|
366
pds/cases/case_1/stock_state.csv
Normal file
366
pds/cases/case_1/stock_state.csv
Normal file
|
|
@ -0,0 +1,366 @@
|
|||
date,amount_in_stock
|
||||
2021-01-01,647479.2516513831
|
||||
2021-01-02,611270.6151648902
|
||||
2021-01-03,533486.4423972561
|
||||
2021-01-04,457004.6287930397
|
||||
2021-01-05,404698.75220385677
|
||||
2021-01-06,347600.1878352536
|
||||
2021-01-07,306034.5007738682
|
||||
2021-01-08,224039.00015402416
|
||||
2021-01-09,152997.08548998268
|
||||
2021-01-10,472251.5969659814
|
||||
2021-01-11,439516.50062731595
|
||||
2021-01-12,406661.0550947753
|
||||
2021-01-13,351240.1210121491
|
||||
2021-01-14,302356.80974864156
|
||||
2021-01-15,253988.21197549443
|
||||
2021-01-16,213762.2171895817
|
||||
2021-01-17,144758.54995178233
|
||||
2021-01-18,77379.61626667128
|
||||
2021-01-19,17935.183637817092
|
||||
2021-01-20,292387.4407724763
|
||||
2021-01-21,711069.23392869
|
||||
2021-01-22,680876.0831249541
|
||||
2021-01-23,618547.5455593257
|
||||
2021-01-24,574857.225400806
|
||||
2021-01-25,710652.8900352417
|
||||
2021-01-26,662858.7507577738
|
||||
2021-01-27,1090650.664424961
|
||||
2021-01-28,1026017.4875181256
|
||||
2021-01-29,958645.8244156246
|
||||
2021-01-30,907508.7560427187
|
||||
2021-01-31,845315.8242601342
|
||||
2021-02-01,782934.5790253138
|
||||
2021-02-02,720190.5475699984
|
||||
2021-02-03,668884.8415464258
|
||||
2021-02-04,616266.1743539482
|
||||
2021-02-05,968862.7606461754
|
||||
2021-02-06,913708.4863026484
|
||||
2021-02-07,873908.8571263258
|
||||
2021-02-08,808421.8782180586
|
||||
2021-02-09,753066.6459285829
|
||||
2021-02-10,1019238.2219733722
|
||||
2021-02-11,1313576.0418210896
|
||||
2021-02-12,1282039.0065675988
|
||||
2021-02-13,1235591.2856686988
|
||||
2021-02-14,1171860.2539031678
|
||||
2021-02-15,1117405.48380467
|
||||
2021-02-16,1076745.9766019788
|
||||
2021-02-17,1013251.97847048
|
||||
2021-02-18,958320.7118255846
|
||||
2021-02-19,930041.9769480445
|
||||
2021-02-20,893662.3380808627
|
||||
2021-02-21,831459.5798203176
|
||||
2021-02-22,776936.3696853134
|
||||
2021-02-23,734540.5173158804
|
||||
2021-02-24,691606.0919001552
|
||||
2021-02-25,640111.3214238406
|
||||
2021-02-26,595891.025376767
|
||||
2021-02-27,934221.6023643162
|
||||
2021-02-28,877114.1085506395
|
||||
2021-03-01,848141.8744925237
|
||||
2021-03-02,805093.1398847107
|
||||
2021-03-03,763587.6058287523
|
||||
2021-03-04,715661.57034632
|
||||
2021-03-05,654382.5748560184
|
||||
2021-03-06,615338.0743317754
|
||||
2021-03-07,578195.4376780196
|
||||
2021-03-08,518810.4274615445
|
||||
2021-03-09,779919.5351500085
|
||||
2021-03-10,737043.7148174229
|
||||
2021-03-11,699745.620588449
|
||||
2021-03-12,646333.721569387
|
||||
2021-03-13,600987.7229182889
|
||||
2021-03-14,547776.3167563358
|
||||
2021-03-15,506801.91593977675
|
||||
2021-03-16,450776.2401082926
|
||||
2021-03-17,407818.3558973169
|
||||
2021-03-18,342353.36305987765
|
||||
2021-03-19,313724.5858530795
|
||||
2021-03-20,262851.4550763895
|
||||
2021-03-21,215636.33972634672
|
||||
2021-03-22,170653.85826396095
|
||||
2021-03-23,97808.41041784057
|
||||
2021-03-24,61151.12686222342
|
||||
2021-03-25,25218.502460950258
|
||||
2021-03-26,-65584.03503789403
|
||||
2021-03-27,-119734.39702784433
|
||||
2021-03-28,146950.75604798403
|
||||
2021-03-29,97153.21441905304
|
||||
2021-03-30,57310.64009173471
|
||||
2021-03-31,10662.581871622475
|
||||
2021-04-01,-27588.618743333966
|
||||
2021-04-02,-82557.57021438742
|
||||
2021-04-03,-121780.90689560089
|
||||
2021-04-04,84432.07206712157
|
||||
2021-04-05,24238.10583310143
|
||||
2021-04-06,-83552.86652671939
|
||||
2021-04-07,-142480.2219082731
|
||||
2021-04-08,-195050.74612612266
|
||||
2021-04-09,41588.074514322594
|
||||
2021-04-10,-11364.844023714257
|
||||
2021-04-11,-66482.1236459639
|
||||
2021-04-12,-128813.02604588126
|
||||
2021-04-13,-189165.18592154793
|
||||
2021-04-14,-235646.37892092072
|
||||
2021-04-15,-262386.42745492875
|
||||
2021-04-16,128207.1126242844
|
||||
2021-04-17,484230.47263176995
|
||||
2021-04-18,415065.4991949436
|
||||
2021-04-19,350012.5057265632
|
||||
2021-04-20,263063.87403928395
|
||||
2021-04-21,215462.95198873535
|
||||
2021-04-22,502931.7009489148
|
||||
2021-04-23,444128.84454191074
|
||||
2021-04-24,416851.5529121987
|
||||
2021-04-25,575677.4656509105
|
||||
2021-04-26,798803.565254669
|
||||
2021-04-27,756329.9209084371
|
||||
2021-04-28,693343.5929958853
|
||||
2021-04-29,633572.7242262983
|
||||
2021-04-30,586605.6140128067
|
||||
2021-05-01,555322.3617422794
|
||||
2021-05-02,510051.40041188453
|
||||
2021-05-03,469851.3389004902
|
||||
2021-05-04,441081.9000312464
|
||||
2021-05-05,399484.615634201
|
||||
2021-05-06,696136.4720517738
|
||||
2021-05-07,664079.5714129838
|
||||
2021-05-08,639953.3389006793
|
||||
2021-05-09,578078.3984912352
|
||||
2021-05-10,508496.2163839203
|
||||
2021-05-11,453782.5063949912
|
||||
2021-05-12,375795.88872781984
|
||||
2021-05-13,324748.85745296953
|
||||
2021-05-14,265033.5293814591
|
||||
2021-05-15,191345.33714884822
|
||||
2021-05-16,125538.30636832467
|
||||
2021-05-17,486699.9090717564
|
||||
2021-05-18,433044.6008993777
|
||||
2021-05-19,379181.34503853624
|
||||
2021-05-20,336733.4798502792
|
||||
2021-05-21,302099.29447029356
|
||||
2021-05-22,220713.48533501168
|
||||
2021-05-23,167038.98676838083
|
||||
2021-05-24,134908.53922642054
|
||||
2021-05-25,99766.58410338087
|
||||
2021-05-26,64386.80915679069
|
||||
2021-05-27,361919.1602337716
|
||||
2021-05-28,311015.7070846562
|
||||
2021-05-29,258417.9931968885
|
||||
2021-05-30,220655.1474713701
|
||||
2021-05-31,188967.8022209354
|
||||
2021-06-01,187586.8123219715
|
||||
2021-06-02,148201.8543062532
|
||||
2021-06-03,85794.10557071284
|
||||
2021-06-04,19937.2721774291
|
||||
2021-06-05,-21222.25646840773
|
||||
2021-06-06,-99515.04498656568
|
||||
2021-06-07,-144600.11278759915
|
||||
2021-06-08,-208569.31457434213
|
||||
2021-06-09,-270434.79377998784
|
||||
2021-06-10,-146080.38556497518
|
||||
2021-06-11,-197744.22441062317
|
||||
2021-06-12,-247206.8338239739
|
||||
2021-06-13,-19232.408561805147
|
||||
2021-06-14,-47054.57870629374
|
||||
2021-06-15,-82331.94894057448
|
||||
2021-06-16,56822.28522437127
|
||||
2021-06-17,-5380.359315638307
|
||||
2021-06-18,-64742.15657142063
|
||||
2021-06-19,-102359.69861953295
|
||||
2021-06-20,-187079.5771196356
|
||||
2021-06-21,-237233.0730349294
|
||||
2021-06-22,-60781.477353804774
|
||||
2021-06-23,-95743.53688423763
|
||||
2021-06-24,219265.19183468865
|
||||
2021-06-25,166018.31299095904
|
||||
2021-06-26,127324.35545632138
|
||||
2021-06-27,62794.68059832805
|
||||
2021-06-28,21668.2514308655
|
||||
2021-06-29,-50316.4801029578
|
||||
2021-06-30,-79204.52348730947
|
||||
2021-07-01,191577.08330515135
|
||||
2021-07-02,141760.78489785508
|
||||
2021-07-03,98948.39846553442
|
||||
2021-07-04,64038.65918802995
|
||||
2021-07-05,26447.1233413148
|
||||
2021-07-06,-13022.080250524916
|
||||
2021-07-07,285296.5291195527
|
||||
2021-07-08,257249.25334153447
|
||||
2021-07-09,589937.2502111658
|
||||
2021-07-10,547332.2642310483
|
||||
2021-07-11,489625.47496736515
|
||||
2021-07-12,451659.6340056894
|
||||
2021-07-13,408940.087223126
|
||||
2021-07-14,372398.90279541345
|
||||
2021-07-15,327219.6904202084
|
||||
2021-07-16,278112.5707611354
|
||||
2021-07-17,249564.69143054486
|
||||
2021-07-18,199849.93454908518
|
||||
2021-07-19,633081.1550744908
|
||||
2021-07-20,560950.8118202476
|
||||
2021-07-21,885190.5961887846
|
||||
2021-07-22,838076.0106605014
|
||||
2021-07-23,775211.1163124711
|
||||
2021-07-24,726945.8405482947
|
||||
2021-07-25,644089.006161145
|
||||
2021-07-26,941593.1369481836
|
||||
2021-07-27,910279.2186288635
|
||||
2021-07-28,858576.4584500947
|
||||
2021-07-29,1188692.7272715634
|
||||
2021-07-30,1145293.3945720182
|
||||
2021-07-31,1089868.8541963038
|
||||
2021-08-01,1047642.9074704085
|
||||
2021-08-02,1012835.3742754249
|
||||
2021-08-03,1238891.4321784496
|
||||
2021-08-04,1211681.9816677598
|
||||
2021-08-05,1154444.895439112
|
||||
2021-08-06,1109275.8181821972
|
||||
2021-08-07,1058247.3735601068
|
||||
2021-08-08,1017256.953908889
|
||||
2021-08-09,985824.1863912917
|
||||
2021-08-10,1275142.1161176958
|
||||
2021-08-11,1207694.6598353714
|
||||
2021-08-12,1151633.8969831534
|
||||
2021-08-13,1115537.8540568247
|
||||
2021-08-14,1033378.6927169448
|
||||
2021-08-15,971994.1544095458
|
||||
2021-08-16,929073.1323963873
|
||||
2021-08-17,871498.3232116804
|
||||
2021-08-18,1108483.0617190541
|
||||
2021-08-19,1070370.8727955446
|
||||
2021-08-20,1027068.5970765499
|
||||
2021-08-21,1361247.2714829298
|
||||
2021-08-22,1309791.1082427092
|
||||
2021-08-23,1258414.6965946767
|
||||
2021-08-24,1212790.1028415759
|
||||
2021-08-25,1166055.3208899843
|
||||
2021-08-26,1128490.2460538154
|
||||
2021-08-27,1104935.8483842565
|
||||
2021-08-28,1084330.9002424532
|
||||
2021-08-29,1017996.6412879428
|
||||
2021-08-30,969948.7871034581
|
||||
2021-08-31,913757.0731994106
|
||||
2021-09-01,1250598.2141536232
|
||||
2021-09-02,1204568.0666521925
|
||||
2021-09-03,1193864.2432135388
|
||||
2021-09-04,1123520.6427849764
|
||||
2021-09-05,1053913.50147074
|
||||
2021-09-06,996981.9493567909
|
||||
2021-09-07,942318.3358728208
|
||||
2021-09-08,884592.806864691
|
||||
2021-09-09,830835.4141095028
|
||||
2021-09-10,777354.6650491382
|
||||
2021-09-11,727752.3731808765
|
||||
2021-09-12,674766.4777472744
|
||||
2021-09-13,637354.7405956141
|
||||
2021-09-14,908897.880879431
|
||||
2021-09-15,886906.8587683073
|
||||
2021-09-16,827398.073433537
|
||||
2021-09-17,785853.9417255967
|
||||
2021-09-18,738975.7754809558
|
||||
2021-09-19,706505.9460452488
|
||||
2021-09-20,644699.676989112
|
||||
2021-09-21,588624.9513246977
|
||||
2021-09-22,535141.1458672826
|
||||
2021-09-23,505063.9366007591
|
||||
2021-09-24,431993.38810376957
|
||||
2021-09-25,387875.01040075195
|
||||
2021-09-26,353740.67433509044
|
||||
2021-09-27,292121.1635336504
|
||||
2021-09-28,262786.2040530068
|
||||
2021-09-29,207945.42564793542
|
||||
2021-09-30,153084.1661070135
|
||||
2021-10-01,115417.47204050998
|
||||
2021-10-02,69902.58229749798
|
||||
2021-10-03,32029.986340895797
|
||||
2021-10-04,257910.21700555782
|
||||
2021-10-05,185741.80633443507
|
||||
2021-10-06,127330.03843891155
|
||||
2021-10-07,62879.39650024672
|
||||
2021-10-08,23033.226504836108
|
||||
2021-10-09,-27979.69656548275
|
||||
2021-10-10,-84173.66837961711
|
||||
2021-10-11,196022.73780922336
|
||||
2021-10-12,137816.2770916728
|
||||
2021-10-13,91328.3314459105
|
||||
2021-10-14,41251.62959627359
|
||||
2021-10-15,-6329.08472873627
|
||||
2021-10-16,-60244.91381143461
|
||||
2021-10-17,-99851.2698825248
|
||||
2021-10-18,-173641.52212470508
|
||||
2021-10-19,-212049.14390664152
|
||||
2021-10-20,-245454.1192965511
|
||||
2021-10-21,-305386.0794143668
|
||||
2021-10-22,-120943.28550890283
|
||||
2021-10-23,-171138.31388707145
|
||||
2021-10-24,-211211.51691554562
|
||||
2021-10-25,15210.595103964442
|
||||
2021-10-26,-46516.747972695215
|
||||
2021-10-27,-108704.63530860818
|
||||
2021-10-28,-162919.51332463368
|
||||
2021-10-29,-230061.855542359
|
||||
2021-10-30,-276549.55492150894
|
||||
2021-10-31,60181.492596672266
|
||||
2021-11-01,11902.539218675753
|
||||
2021-11-02,-8816.14378848672
|
||||
2021-11-03,-66954.54444227618
|
||||
2021-11-04,-116676.84740239033
|
||||
2021-11-05,-153418.98585937332
|
||||
2021-11-06,-196155.47476637954
|
||||
2021-11-07,-251512.16333905573
|
||||
2021-11-08,-333344.50629424525
|
||||
2021-11-09,-4059.411425020022
|
||||
2021-11-10,-43261.74829909939
|
||||
2021-11-11,-106048.24832104275
|
||||
2021-11-12,-143774.93807254065
|
||||
2021-11-13,-210808.42267524963
|
||||
2021-11-14,-266175.2330804739
|
||||
2021-11-15,-320073.4749942003
|
||||
2021-11-16,-382919.4569090524
|
||||
2021-11-17,-416753.2852401128
|
||||
2021-11-18,-477830.28394004394
|
||||
2021-11-19,-529058.3960308388
|
||||
2021-11-20,-584693.8663060239
|
||||
2021-11-21,-656496.8774633836
|
||||
2021-11-22,-398005.2872290472
|
||||
2021-11-23,-458715.2946404286
|
||||
2021-11-24,-531964.3107156917
|
||||
2021-11-25,-589663.322212392
|
||||
2021-11-26,-636461.6149367143
|
||||
2021-11-27,-672820.8031147933
|
||||
2021-11-28,-734332.3240520869
|
||||
2021-11-29,-773617.0527816914
|
||||
2021-11-30,-802079.1205139998
|
||||
2021-12-01,-525354.9727204265
|
||||
2021-12-02,-584780.1553593907
|
||||
2021-12-03,-627794.2090558368
|
||||
2021-12-04,-680563.7169338213
|
||||
2021-12-05,-358688.0285447965
|
||||
2021-12-06,-417863.17287740955
|
||||
2021-12-07,-94466.31801389478
|
||||
2021-12-08,-120354.06949547637
|
||||
2021-12-09,270468.6405604635
|
||||
2021-12-10,220782.1644699257
|
||||
2021-12-11,525267.2813442927
|
||||
2021-12-12,482176.8629086895
|
||||
2021-12-13,453361.41842871887
|
||||
2021-12-14,421915.6790918901
|
||||
2021-12-15,370951.4788054582
|
||||
2021-12-16,333261.71358073386
|
||||
2021-12-17,293991.26921963337
|
||||
2021-12-18,230223.3400138117
|
||||
2021-12-19,163977.57136618256
|
||||
2021-12-20,99667.54491378451
|
||||
2021-12-21,79481.0786327979
|
||||
2021-12-22,250930.1081393262
|
||||
2021-12-23,426844.782771413
|
||||
2021-12-24,366615.4882019885
|
||||
2021-12-25,308825.2904883709
|
||||
2021-12-26,248976.98635886348
|
||||
2021-12-27,200133.51200007505
|
||||
2021-12-28,154650.06743391437
|
||||
2021-12-29,109288.25307168259
|
||||
2021-12-30,52184.36661215486
|
||||
2021-12-31,2705.043157733511
|
||||
|
10
pds/cases/case_1/summary_first_sweep.csv
Normal file
10
pds/cases/case_1/summary_first_sweep.csv
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
reorder_point_factor,purchase_size_factor,service_level_mean,service_level_median,service_level_std,service_level_count,mean_stock_level_mean,mean_stock_level_median,mean_stock_level_std,mean_stock_level_count,purchase_order_count_mean,purchase_order_count_median,purchase_order_count_std,purchase_order_count_count
|
||||
0.8,0.8,0.0684931506849315,0.0726027397260274,0.0222201370969798,10,-1594714.1742160032,-1530433.4046675265,285066.2951297739,10,50.2,50.0,1.3984117975602024,10
|
||||
0.8,1.0,0.5816438356164383,0.6520547945205479,0.25980427056171707,10,-20433.232547621035,66493.16878082216,231209.05072598366,10,49.4,49.5,0.9660917830792962,10
|
||||
0.8,1.2,0.9356164383561645,0.9534246575342465,0.040805672352052756,10,260408.40724531026,264591.4202889103,34451.38595202987,10,42.5,42.5,0.5270462766947288,10
|
||||
1.0,0.8,0.11863013698630136,0.10547945205479452,0.06135803865213693,10,-1360077.266559611,-1421026.0243578043,341686.4813035888,10,50.7,50.5,1.3374935098492577,10
|
||||
1.0,1.0,0.6550684931506849,0.7821917808219179,0.2787601486044031,10,63898.06455496148,158892.80360797068,215553.80705682412,10,49.3,49.5,1.1595018087284057,10
|
||||
1.0,1.2,0.9904109589041095,0.9945205479452055,0.011854570763239407,10,360626.1147252074,359297.0984386411,24074.260208145475,10,42.1,42.0,0.5676462121975469,10
|
||||
1.2,0.8,0.14684931506849314,0.11095890410958904,0.1127785478486988,10,-1471541.3243492458,-1590944.9289921233,402072.5562878826,10,50.1,50.5,1.7919573407620821,10
|
||||
1.2,1.0,0.8868493150684932,0.963013698630137,0.15021679044253444,10,289885.33637142787,340960.57915301056,116064.12202102688,10,49.9,50.0,0.7378647873726214,10
|
||||
1.2,1.2,0.996986301369863,1.0,0.007126799274932135,10,464072.69404238986,464252.8407907331,35729.24312964791,10,42.0,42.0,0.6666666666666669,10
|
||||
|
26
pds/cases/case_1/summary_second_sweep.csv
Normal file
26
pds/cases/case_1/summary_second_sweep.csv
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
reorder_point_factor,purchase_size_factor,service_level_mean,service_level_median,service_level_std,service_level_count,mean_stock_level_mean,mean_stock_level_median,mean_stock_level_std,mean_stock_level_count,purchase_order_count_mean,purchase_order_count_median,purchase_order_count_std,purchase_order_count_count
|
||||
0.8,1.0,0.5629041095890411,0.5630136986301371,0.25173917949278124,100,-17208.65752949769,31032.43630715287,200730.55535889775,100,49.05,49.0,1.166666666666668,100
|
||||
0.8,1.05,0.804986301369863,0.8452054794520547,0.14385248604678155,100,155614.19545368513,176960.00812669177,89250.77498164216,100,47.39,47.0,0.7900262110470866,100
|
||||
0.8,1.1,0.8659726027397261,0.8876712328767123,0.09160908657556802,100,198680.3804320387,207071.20423920936,54616.27896318188,100,45.45,45.0,0.7017294652672376,100
|
||||
0.8,1.15,0.924082191780822,0.9342465753424658,0.042773373946112477,100,240782.04918482568,243459.64652624974,29223.097332241305,100,43.46,43.5,0.7305733185227711,100
|
||||
0.8,1.2,0.9414794520547946,0.9493150684931506,0.03451593530365504,100,261676.29869938738,264285.581551831,25131.022316170343,100,41.83,42.0,0.6971080231639825,100
|
||||
0.9,1.0,0.6648493150684932,0.6945205479452055,0.21570939170830844,100,73024.72198996953,104935.78104756039,163647.97407003478,100,49.32,49.0,0.8862587350511948,100
|
||||
0.9,1.05,0.8186575342465754,0.8753424657534246,0.16907143140798406,100,182114.7427397742,214236.05435841338,108978.10420990313,100,47.46,47.0,0.9147500624584167,100
|
||||
0.9,1.1,0.9226849315068493,0.9397260273972603,0.06860053019119008,100,257549.83941332222,264802.2368256551,46594.05059506942,100,45.65,46.0,0.7833494518006421,100
|
||||
0.9,1.15,0.9611506849315069,0.9726027397260274,0.040083238669095175,100,297073.0555063267,302993.9769790715,33827.59431750586,100,43.63,44.0,0.7057484028184599,100
|
||||
0.9,1.2,0.9742739726027397,0.9808219178082191,0.020594090521446923,100,316243.2068669456,319849.0246099904,23997.41545045925,100,42.05,42.0,0.6871842709362761,100
|
||||
1.0,1.0,0.6921643835616439,0.7698630136986302,0.2448481301495943,100,101882.22346645949,160026.78900577017,180014.0847194441,100,49.41,49.0,1.0739806066379143,100
|
||||
1.0,1.05,0.8867945205479453,0.936986301369863,0.1266759950750295,100,246218.68552190147,273469.8906422792,85390.22913704212,100,47.72,48.0,0.7923880286064316,100
|
||||
1.0,1.1,0.9432054794520548,0.9698630136986301,0.07141874718689835,100,301924.2700638766,316299.9013534653,59963.75704883238,100,45.76,46.0,0.7123726184201268,100
|
||||
1.0,1.15,0.9764109589041096,0.9863013698630136,0.02872101571594946,100,340290.7186400273,343600.27244723897,34849.39399657999,100,43.88,44.0,0.7286350876186868,100
|
||||
1.0,1.2,0.9906575342465753,0.9945205479452055,0.0113001726894409,100,369036.41037286026,371895.01996879186,24001.498220542777,100,42.05,42.0,0.6256309946079575,100
|
||||
1.1,1.0,0.7282465753424657,0.7479452054794521,0.2260275046018253,100,139083.56089769275,162758.51029021217,168922.45751711642,100,49.45,49.5,1.0576799462440758,100
|
||||
1.1,1.05,0.9035068493150685,0.9671232876712329,0.16213843415295967,100,289746.11535166804,320941.33405487105,114866.00516221055,100,47.71,48.0,0.7951240294584386,100
|
||||
1.1,1.1,0.9613698630136986,0.989041095890411,0.0655565291501118,100,350031.4173621522,367119.16888596804,60281.0758667702,100,45.9,46.0,0.7719841941125448,100
|
||||
1.1,1.15,0.9912054794520548,0.9972602739726028,0.017645347308402025,100,396603.9442134802,400346.3145094304,29483.57515994371,100,44.0,44.0,0.7247430753394793,100
|
||||
1.1,1.2,0.9956164383561643,1.0,0.007052473418545561,100,417138.91165137023,418615.9689806167,23055.605401908946,100,42.1,42.0,0.6741998624632427,100
|
||||
1.2,1.0,0.7846575342465754,0.8698630136986301,0.2252867428579435,100,193695.8595228242,242047.6119066357,194075.09374543617,100,49.79,50.0,1.121822110891404,100
|
||||
1.2,1.05,0.9479178082191781,0.9780821917808219,0.09026491930718351,100,346443.9102815047,358689.5454693798,87392.79621129965,100,48.05,48.0,0.7436600722307887,100
|
||||
1.2,1.1,0.9872602739726026,0.9972602739726028,0.025089991771959474,100,411297.4581000472,416474.64406344807,44380.80426082012,100,46.0,46.0,0.7106690545187017,100
|
||||
1.2,1.15,0.9916438356164383,1.0,0.022282747753160106,100,441406.6727818038,448100.49807167007,38234.435371301166,100,44.19,44.0,0.7063206700139026,100
|
||||
1.2,1.2,0.9969589041095891,1.0,0.007179214412726819,100,468382.008571895,474174.00471737224,28487.211871335898,100,42.35,42.0,0.6723244767373897,100
|
||||
|
71
pds/cases/case_1/summary_third_sweep.csv
Normal file
71
pds/cases/case_1/summary_third_sweep.csv
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
reorder_point_factor,purchase_size_factor,service_level_mean,service_level_median,service_level_std,service_level_count,mean_stock_level_mean,mean_stock_level_median,mean_stock_level_std,mean_stock_level_count,purchase_order_count_mean,purchase_order_count_median,purchase_order_count_std,purchase_order_count_count
|
||||
0.8,1.05,0.7859726027397261,0.8260273972602741,0.1598362225708639,100,144208.47823315178,169318.30356595665,100514.74254469664,100,47.4,47.0,0.8164965809277261,100
|
||||
0.8,1.06,0.794958904109589,0.8301369863013699,0.1403919914831539,100,153586.2551041631,173418.410864591,78290.88655784576,100,47.11,47.0,0.7371114795831993,100
|
||||
0.8,1.07,0.8067671232876712,0.8315068493150686,0.1339955549137507,100,161441.590865957,172098.93199610294,72690.59543201819,100,46.56,47.0,0.7291893935852132,100
|
||||
0.8,1.08,0.8381917808219178,0.8493150684931507,0.10243407881742274,100,180757.48462696798,185912.87023764107,63117.92391789514,100,46.47,46.0,0.7843803447642761,100
|
||||
0.8,1.09,0.8667671232876712,0.8808219178082193,0.08505385831720369,100,198896.08671044532,205127.32601251808,47198.21828806646,100,45.77,46.0,0.664466064983872,100
|
||||
0.8,1.1,0.878027397260274,0.9054794520547945,0.09679462977911307,100,207399.79024280803,225251.01385664742,55542.82909581238,100,45.52,46.0,0.7032392583932264,100
|
||||
0.8,1.11,0.8961643835616439,0.9123287671232877,0.06811908370060707,100,218048.13332393923,226635.2932288471,41083.817034265245,100,45.0,45.0,0.7654139963827331,100
|
||||
0.8,1.12,0.9054246575342466,0.9178082191780822,0.05473703917338135,100,226233.79870989014,228435.7464824344,33790.75003378518,100,44.75,45.0,0.770346898114313,100
|
||||
0.8,1.13,0.9113972602739726,0.9219178082191781,0.057722017942900286,100,229820.05176361586,234205.64538325084,37180.29105911812,100,44.41,44.0,0.6371495868001452,100
|
||||
0.8,1.14,0.9096164383561645,0.9260273972602739,0.06476061395141362,100,229451.0061609741,236898.16887785456,39996.703715484575,100,43.98,44.0,0.6192207550093444,100
|
||||
0.9,1.05,0.799068493150685,0.8589041095890411,0.17478733730560359,100,170856.8688515813,195706.0585029618,107559.81482477198,100,47.66,48.0,0.7278028371042323,100
|
||||
0.9,1.06,0.8728493150684932,0.9178082191780822,0.14035816656132336,100,214583.50564701803,237766.20853748685,91537.75933622228,100,47.16,47.0,0.9180567971690441,100
|
||||
0.9,1.07,0.8863835616438357,0.9246575342465753,0.13202268131162476,100,225962.8131575521,248956.4255873827,87091.59551249178,100,46.85,47.0,0.7703468981143126,100
|
||||
0.9,1.08,0.8878356164383561,0.9109589041095891,0.1034915126220675,100,231793.74733914566,241230.59100630687,65364.238707012075,100,46.37,46.0,0.7608474807008903,100
|
||||
0.9,1.09,0.910958904109589,0.9342465753424658,0.0848895391251729,100,247414.19854095648,259646.62831328082,56859.363211731616,100,46.14,46.0,0.829019135649309,100
|
||||
0.9,1.1,0.9097808219178083,0.936986301369863,0.09263505453625975,100,248051.95584330414,261613.48309493947,62298.32416064076,100,45.61,46.0,0.8027100562117265,100
|
||||
0.9,1.11,0.9249041095890411,0.9493150684931506,0.06777942231931827,100,259875.5154301237,265650.987470857,44837.543279018144,100,45.24,45.0,0.7123726184201262,100
|
||||
0.9,1.12,0.9426575342465753,0.958904109589041,0.054991006506983194,100,276332.38956547884,283931.61956175056,40395.41216420654,100,44.78,45.0,0.7327821620165825,100
|
||||
0.9,1.13,0.9434794520547944,0.9657534246575343,0.05636688915712585,100,277312.20724561514,285598.0109710443,42114.061861274546,100,44.54,44.0,0.6422812876966388,100
|
||||
0.9,1.14,0.9461369863013698,0.9671232876712329,0.05949943242463646,100,281586.1900728949,292772.94372766616,44568.637852341606,100,44.05,44.0,0.7436600722307894,100
|
||||
0.95,1.05,0.8504657534246576,0.8876712328767123,0.1426216962196151,100,209502.91100042395,231229.60137442837,98473.14510338863,100,47.62,48.0,0.7885544888073256,100
|
||||
0.95,1.06,0.8763561643835617,0.9205479452054794,0.13371982345233996,100,232132.86769214022,253984.80407355353,85226.62571623079,100,47.18,47.0,0.7571877794400369,100
|
||||
0.95,1.07,0.8897534246575343,0.9232876712328767,0.11000276133429772,100,244444.98080390875,258917.87933101476,70323.6063035861,100,46.75,47.0,0.7833494518006393,100
|
||||
0.95,1.08,0.9206301369863015,0.958904109589041,0.09976094450434589,100,265926.47402984084,283736.9000909083,66614.08688632757,100,46.37,46.0,0.812217316792107,100
|
||||
0.95,1.09,0.9294794520547945,0.958904109589041,0.08543716778698167,100,274030.97554696375,285147.23292353324,56892.76092575346,100,46.01,46.0,0.7452882297839849,100
|
||||
0.95,1.1,0.9287123287671233,0.9547945205479451,0.08003250087101145,100,274078.3527874601,283856.4572754771,56690.76457159778,100,45.64,46.0,0.6744994402884967,100
|
||||
0.95,1.11,0.9364383561643835,0.9561643835616438,0.06526268605058627,100,280881.6829739677,296677.6782650106,49506.88718738129,100,45.34,45.0,0.6391281940932124,100
|
||||
0.95,1.12,0.9556438356164384,0.973972602739726,0.07386818268433056,100,298727.4002688783,311051.6643517049,55230.95325025695,100,44.94,45.0,0.6327748733981471,100
|
||||
0.95,1.13,0.9625479452054795,0.9753424657534246,0.03853770121887277,100,303624.8432092603,305964.4471615079,33997.45186113061,100,44.56,45.0,0.6562827673397108,100
|
||||
0.95,1.14,0.965041095890411,0.9808219178082191,0.04503533313503058,100,309887.30047959444,316649.4679522059,37629.163123648126,100,44.27,44.0,0.6942039987778751,100
|
||||
1.0,1.05,0.878054794520548,0.9232876712328767,0.12456329754626162,100,239357.93264631205,263694.2998236382,80089.22781996857,100,47.79,48.0,0.8680059581790576,100
|
||||
1.0,1.06,0.8947123287671234,0.941095890410959,0.1355028323290669,100,255749.40900901722,285246.23294684856,94956.97950416044,100,47.34,47.0,0.7683118053909035,100
|
||||
1.0,1.07,0.9047945205479452,0.9438356164383561,0.13250530459875723,100,264039.6231237091,286009.00904912734,90347.19839737378,100,46.86,47.0,0.7787584005740479,100
|
||||
1.0,1.08,0.9243287671232876,0.952054794520548,0.08231970120182112,100,281449.77736003743,293460.12722831377,61529.54372494277,100,46.59,47.0,0.726065917924618,100
|
||||
1.0,1.09,0.9343013698630136,0.9643835616438357,0.08847012172074435,100,291842.87457335443,304680.33844471246,67944.88567969218,100,45.95,46.0,0.74366007223079,100
|
||||
1.0,1.1,0.9562739726027396,0.9753424657534246,0.05972417397215357,100,312685.41726779164,317915.94000983867,49197.89880376956,100,45.67,46.0,0.7792122414154682,100
|
||||
1.0,1.11,0.968958904109589,0.9808219178082191,0.03477533957582285,100,323801.7037949509,331782.3224302352,37926.45459276231,100,45.43,45.0,0.781800563578795,100
|
||||
1.0,1.12,0.9685479452054794,0.9835616438356164,0.04226908937517442,100,325205.9243724567,337201.9597184559,45250.733446382925,100,44.9,45.0,0.6890192121758836,100
|
||||
1.0,1.13,0.9677808219178082,0.9808219178082191,0.04733685887394322,100,330657.6603956923,337075.92965660174,42421.01611114322,100,44.6,45.0,0.7247430753394793,100
|
||||
1.0,1.14,0.9823013698630138,0.9917808219178083,0.02489902195487209,100,346636.5895811218,351643.50356452586,32724.192897340898,100,44.11,44.0,0.6947857747012907,100
|
||||
1.05,1.05,0.9096712328767123,0.9506849315068493,0.1268551724970295,100,275036.8994307617,290241.47330518905,92189.74314580947,100,47.76,48.0,0.8542230210530327,100
|
||||
1.05,1.06,0.9146575342465754,0.9561643835616438,0.12009700618062043,100,283383.00552277366,305048.07351176,96246.65543086598,100,47.27,47.0,0.7365631354644712,100
|
||||
1.05,1.07,0.9413972602739726,0.9698630136986301,0.09003060152571733,100,303722.93403703946,313331.6029302139,73057.08547382594,100,46.91,47.0,0.7533762390570582,100
|
||||
1.05,1.08,0.9469315068493152,0.9780821917808219,0.0793003279699756,100,317055.4136440441,329838.54958045797,63485.26929871185,100,46.59,47.0,0.7666666666666667,100
|
||||
1.05,1.09,0.9626575342465753,0.9835616438356164,0.050483002706923574,100,327783.50728198123,337811.29494201415,48868.03042293043,100,46.26,46.0,0.7603826787755086,100
|
||||
1.05,1.1,0.9624109589041097,0.9794520547945205,0.05435562429151819,100,331620.04862504784,339715.6067690905,51905.17082289278,100,45.78,46.0,0.7464393593398702,100
|
||||
1.05,1.11,0.9697534246575343,0.989041095890411,0.04971307496436453,100,340227.99533744523,351120.098823712,49956.8593361718,100,45.43,45.0,0.7420283421851632,100
|
||||
1.05,1.12,0.9702739726027397,0.9863013698630136,0.05158788657894017,100,343659.58516506077,353342.32752993377,44689.97958762292,100,45.05,45.0,0.7299508769967222,100
|
||||
1.05,1.13,0.9841643835616438,0.9917808219178083,0.021220325968317567,100,362923.71636342397,367782.8510066926,30511.492738523157,100,44.68,45.0,0.7089613971340485,100
|
||||
1.05,1.14,0.9803287671232878,0.989041095890411,0.03439019008566572,100,358818.66979266173,366030.73615185026,38779.97603060032,100,44.42,44.0,0.6693883835866954,100
|
||||
1.1,1.05,0.8774520547945205,0.9493150684931506,0.16332896109997266,100,262116.4533938322,307218.83635365096,137001.0438185493,100,47.65,48.0,0.845367650579594,100
|
||||
1.1,1.06,0.93,0.9575342465753425,0.08998299067660721,100,308184.9288191942,315262.4431269691,76531.77678714157,100,47.33,47.0,0.7114503609961922,100
|
||||
1.1,1.07,0.9332054794520548,0.9767123287671233,0.1133241844881452,100,316339.8582983121,343388.79801796563,88723.83399772066,100,47.18,47.0,0.7704124567628391,100
|
||||
1.1,1.08,0.9466849315068494,0.9767123287671233,0.09839032697603153,100,331184.26416084,349136.8427766626,81927.62325661813,100,46.52,47.0,0.8346050901867643,100
|
||||
1.1,1.09,0.9556164383561644,0.989041095890411,0.10547415073320952,100,344293.7967364825,363724.13265618257,85256.01192642892,100,46.26,46.0,0.7333333333333325,100
|
||||
1.1,1.1,0.9733150684931507,0.9945205479452055,0.06351837655542099,100,363147.94176298834,374326.82103307196,57145.65533432398,100,45.75,46.0,0.6256309946079563,100
|
||||
1.1,1.11,0.9746849315068493,0.9917808219178083,0.04402911492630584,100,363388.1927891669,373491.37867364136,49274.54501585131,100,45.5,45.0,0.6435381994422805,100
|
||||
1.1,1.12,0.9793972602739726,0.9917808219178083,0.03915141511936552,100,370890.05170730536,376338.38252097333,44302.65600471223,100,45.1,45.0,0.7035264706814484,100
|
||||
1.1,1.13,0.9804109589041096,0.9945205479452055,0.03243412017637617,100,377327.82974791917,381348.09184570936,38488.17279855358,100,44.76,45.0,0.7123726184201263,100
|
||||
1.1,1.14,0.9886849315068492,0.9945205479452055,0.017334789000443024,100,384809.10717216856,390844.7511152257,31093.991487524258,100,44.51,44.0,0.6589707309451781,100
|
||||
1.2,1.05,0.9171780821917808,0.9726027397260274,0.13067274741673798,100,322060.45665888296,340538.9200925699,105710.6766863121,100,47.92,48.0,0.8490041700769674,100
|
||||
1.2,1.06,0.9489041095890411,0.9917808219178083,0.09929085079019878,100,355803.9539068448,384192.0333909353,97019.18401447838,100,47.61,48.0,0.7771353768420244,100
|
||||
1.2,1.07,0.9564109589041097,0.9917808219178083,0.07656699649287621,100,364057.84548111144,389141.36283888033,75902.53849836365,100,47.31,47.0,0.6918720031095832,100
|
||||
1.2,1.08,0.9602465753424657,0.989041095890411,0.08505995544913891,100,373446.1741382272,386689.89061583555,83449.85958080231,100,46.81,47.0,0.6918720031095821,100
|
||||
1.2,1.09,0.9672054794520548,0.9945205479452055,0.08413140089715565,100,390837.72881569655,407689.56891719927,79174.94776761712,100,46.26,46.0,0.7194273817250479,100
|
||||
1.2,1.1,0.9738356164383561,0.9972602739726028,0.060117001280751294,100,398871.1618030684,414081.79698469874,60975.215674990715,100,46.23,46.0,0.6794977348874467,100
|
||||
1.2,1.11,0.9765205479452055,0.9972602739726028,0.05166994864627592,100,404329.81311479496,423147.71118130337,66661.79450110722,100,45.64,46.0,0.6744994402884964,100
|
||||
1.2,1.12,0.9849315068493151,0.9972602739726028,0.04728618617716756,100,424054.9128070699,431696.0971162426,53638.952963032265,100,45.25,45.0,0.7436600722307911,100
|
||||
1.2,1.13,0.991041095890411,0.9986301369863013,0.018392476408138413,100,428392.03453004366,434494.4380003613,39705.52165661862,100,44.91,45.0,0.6528105515090998,100
|
||||
1.2,1.14,0.992986301369863,1.0,0.01664151932365369,100,438627.18168542744,445798.6518808934,35926.80443305188,100,44.45,44.0,0.6871842709362769,100
|
||||
|
BIN
pds/cases/case_2/Case 2 description.pdf
Normal file
BIN
pds/cases/case_2/Case 2 description.pdf
Normal file
Binary file not shown.
80
pds/cases/case_2/Case 2.md
Normal file
80
pds/cases/case_2/Case 2.md
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
|
||||
You have been hired by Beanie Limited, the coffee company, for a new project on their Diemen distribution center (DC). Your contact for this engagement is Jeroen Schotten, the manager of the facility.
|
||||
|
||||
The Diemen DC is the entrypoint of Beanie Limited's supply chain in Europe. Beanie Limited purchases raw coffee beans in different regions of Latin America that are sent by ship to docks in Europe. Once the beans reach Europe, all the stock is centralized in Diemen before continuing its path through Beanie Limited's network. The Diemen DC does not serve customers directly, but rather other distribution centers of Beanie Limited and some partner companies. These regional DCs are smaller and are the ones responsible for interacting with clients directly in their assigned areas.
|
||||
|
||||
As of today, Beanie Limited only handles raw coffee beans through it's sales network and supply chain. But this is going to change very soon, which is the reason Jeroen has decided to hire you.
|
||||
|
||||
Beanie Limited is currently working on an expansion of their Diemen DC, with the goal of adding a processing facility for coffee. This processing facility will be capable of producing roasted coffee beans, both regular and decaffeinated. The company expects to have this new extension operational by the start of next year, when it will expand its product portfolio from the current one (only raw coffee beans) to also include the new products (raw coffee beans, roasted coffee beans and decaffeinated coffee beans).
|
||||
|
||||
Roasted coffee beans are obtained by placing raw coffee beans into cylinders where hot air is blown. Beans are heated to ~250ºC for around 12 minutes. The cylinder rotates to ensure that beans are roasted evenly. On the other hand, decaff coffee can be obtained through several methods. Beanie Limited employs the chemical solvent method, which consists on steaming and rinsing the raw coffee beans with Ethyl Acetate. After removing the chemical agent, the beans are roasted just like regular coffee. The new facility comes with one limitation: there is only one cylinder production line. This means that, on any given day, it can only produce roasted or decaff coffee, but not both. Changing from one product to the other is a hefty task known as a changeover, which typically leaves the line out of order for some time.
|
||||
|
||||
Jeroen faces two challenges:
|
||||
- On one hand, he must decide how will the production line be managed regarding how capacity gets split between the two processed products, roasted and decaff beans.
|
||||
- On the other hand, the new changes also imply that Diemen's raw coffee beans stock will not only play the role of providing other regional DCs with the raw beans they need, but will also be a raw material for the processing facility. Jeroen thinks that his replenishment policy should be reviewed to ensure that it satisfies the current situation.
|
||||
|
||||
In order to tackle this, Jeroen would like to receive proposals from you regarding the management of the production line and the policy to order shipments from Latin America. He trusts that your simulation and optimization skills will assist in providing a good solution, since the complexities of the operation have proven to be a tough bone for his team.
|
||||
|
||||
|
||||
## Detailed task definition
|
||||
|
||||
- Below you will find four levels of questions. Levels 1 to 3 are compulsory.
|
||||
Level 4 is optional.
|
||||
- You need to write a report document where you answer the questions of the
|
||||
different levels. This report should be directed towards Jeroen, should give
|
||||
her clear recommendations and should justify these recommendations. It's
|
||||
important for you to reflect your methodology to back your proposals.
|
||||
- Each level is worth 2 points out of a total of 10. The 2 missing points will
|
||||
grade the clarity and structure of your report and code.
|
||||
- You need to use a Python notebook to solve all levels. A helper notebook is
|
||||
provided. Please attach a notebook that shows your
|
||||
solution/proposal/analysis.
|
||||
- Include your team number, names and student IDs in all your deliverables.
|
||||
|
||||
|
||||
## Data and other facts
|
||||
|
||||
A few general facts provided by Jeroen's team:
|
||||
- The production line can roast 125.000 daily kilograms of coffee, or 70.000 daily kilograms if it's decaffeinated.
|
||||
- Since the company was not selling roasted and decaf coffee before, there is no historical data for sales. Nevertheless, these are the forecasts you have received:
|
||||
- Jeroen expects to receive about 3 orders per week for roasted coffee. He expects each order to be somewhere between 200.000 and 300.000, with 250.000 being the expected "typical" amount.
|
||||
- As for the decaff, he expects 1 order per week, with a similar sizing of the roasted coffee ones.
|
||||
- Switching the line from one product to another takes somewhere between 24 to 48 hours. This also includes stopping the line to not produce anything, and starting the line again.
|
||||
- You can assume that producing one kilogram of roasted coffee or one kilogram of decaff coffee consumes one kilogram of raw coffee beans.
|
||||
- Jeroen's team have indicated that you should ensure that the line always runs production batches of at least 5 days. This means, once the line gets prepared for a specific product, it should produce for at least 5 days before switching to another product or stopping. Running batches of more than 5 days is perfectly fine.
|
||||
- Only one order from Latin America to Diemen can be active at the same time.
|
||||
|
||||
You have also received two tables that contain real data from the past 2 years:
|
||||
- served_orders: this table shows every order that was served by the Diemen DC in the past years. This means, each record corresponds to one request of raw coffee beans that one of the regional DCs placed to Diemen and Diemen served. The units are kilograms.
|
||||
- sourcing_events: this table shows the Purchase Orders Diemen placed to it's Latin American providers. For each order, there are two dates: the date when
|
||||
the order was placed, and the date where the beans actually reached Diemen. The units are kilograms.
|
||||
|
||||
|
||||
## Notebook
|
||||
|
||||
A notebook with some helping code has been provided. The code contains a small
|
||||
simulation engine that can help you simulate a year of activity for the
|
||||
distribution center. The instructions on how to use the code are in the notebook itself.
|
||||
|
||||
|
||||
## Levels
|
||||
|
||||
- Level 1
|
||||
- Jeroen wants you to provide a purchasing policy and a production line policy. This means your policies define when to buy more beans and how much, and what production should be on the production line everyday.
|
||||
- He would like to achieve a service level of 99% for raw coffee beans, and of 95% for roasted and decaff beans.
|
||||
- Level 2
|
||||
- As part of the new processing facility, additional warehousing space will also be added to the Diemen DC. Currently, the location can hold up to 20,000 tons of beans. Jeroen would like your advice on how much additional storage should be built to guarantee that the warehouse never exceeds its capacity.
|
||||
- Level 3
|
||||
- Traditionally, Jeroen's team has followed a rule of only having one shipment coming from Latin America to Diemen at the same time, mostly for simplicity's sake. Nevertheless, Jeroen is wondering: how much would allowing up to 3 shipments to be on the way simultaneously help Diemen? Would it improve any metrics significantly?
|
||||
- Bear in mind that any orders placed to Latin American providers should be of, at least, 3000 tons of beans.
|
||||
- Level 4
|
||||
- Out of the three products that Diemen will handle, decaffeinated beans are the smallest one in volume and relevance. Jeroen is wondering: if the service level was downgraded from the original 95% to 75%, how much would that benefit the DC and its metrics?
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
686
pds/cases/case_2/Diemen_case_2_my_notebook.ipynb
Normal file
686
pds/cases/case_2/Diemen_case_2_my_notebook.ipynb
Normal file
|
|
@ -0,0 +1,686 @@
|
|||
{
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"name": "python3",
|
||||
"display_name": "Python 3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"# Case 2 - Student Notebook"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "oHWpkTqMeBMq"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"## Imports and data loading"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "BhR7Z_UqeEgm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "HQwlyagxfXRU"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import io\n",
|
||||
"import pandas as pd\n",
|
||||
"import numpy as np\n",
|
||||
"import seaborn as sns\n",
|
||||
"from google.colab import files\n",
|
||||
"from datetime import datetime, timedelta"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# This avoids scientific notation on millions and larger\n",
|
||||
"pd.set_option('display.float_format', lambda x: '%.2f' % x)"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "wsv3gEB9qmp6"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# Upload files from your computer here\n",
|
||||
"# Run the cell and click the \"Browse\" button to upload the provided CSV \n",
|
||||
"# files\n",
|
||||
"uploaded = files.upload()"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "4psao7htcAwr"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# Read the files as pandas dataframes and print them so you can check that the\n",
|
||||
"# process went fine\n",
|
||||
"\n",
|
||||
"served_orders = pd.read_csv(io.BytesIO(uploaded['served_orders.csv']))\n",
|
||||
"sourcing_events = pd.read_csv(io.BytesIO(uploaded['sourcing_events.csv']))\n",
|
||||
"\n",
|
||||
"for table in (served_orders, sourcing_events):\n",
|
||||
" print(table.head())"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "X8N0PZ4qcOls"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"## Analysis"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "GKty74ZfuBEG"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# You can use this space to analyse the provided data as you see fit."
|
||||
],
|
||||
"metadata": {
|
||||
"id": "CuYSBC2auDIG"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"## Provided code\n"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "KM5HVJiIfYPC"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# This cell includes provided code to run simulations.\n",
|
||||
"# You do not need to understand the internals of this code. Feel free to just\n",
|
||||
"# run it and move forward.\n",
|
||||
"# The next section explains how you can call this code to run your simulations.\n",
|
||||
"\n",
|
||||
"base = datetime(2022,1,1)\n",
|
||||
"dates_in_2022 = [base + timedelta(days=x) for x in range(365)]\n",
|
||||
"\n",
|
||||
"class SimulationResult:\n",
|
||||
"\n",
|
||||
" def __init__(self, stock_states, demand_by_day, sourcing_events):\n",
|
||||
" self.stock_states = stock_states\n",
|
||||
" self.demand_by_day = demand_by_day\n",
|
||||
" self.sourcing_events = sourcing_events\n",
|
||||
"\n",
|
||||
" def plot_stock_history(self):\n",
|
||||
" sns.lineplot(x=dates_in_2022, y=self.stock_states)\n",
|
||||
"\n",
|
||||
" def plot_stock_distribution(self):\n",
|
||||
" sns.histplot(x=self.stock_states, kde=True)\n",
|
||||
"\n",
|
||||
" def service_level(self):\n",
|
||||
" return (self.stock_states > 0 ).astype(int).mean()\n",
|
||||
"\n",
|
||||
" def stock_level_summary(self):\n",
|
||||
" print(\n",
|
||||
" pd.DataFrame(self.stock_states).describe()\n",
|
||||
" ) \n",
|
||||
" \n",
|
||||
" def mean_stock_level(self):\n",
|
||||
" return self.stock_states.mean()\n",
|
||||
"\n",
|
||||
" def median_stock_level(self):\n",
|
||||
" return np.median(self.stock_states)\n",
|
||||
"\n",
|
||||
" def stdev_stock_level(self):\n",
|
||||
" return self.stock_states.std()\n",
|
||||
"\n",
|
||||
" def mean_demand(self):\n",
|
||||
" return self.demand_by_day.mean()\n",
|
||||
" \n",
|
||||
" def number_of_purchase_orders_placed(self):\n",
|
||||
" return len(self.sourcing_events)\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class SimulationConfig:\n",
|
||||
"\n",
|
||||
" def __init__(\n",
|
||||
" self, \n",
|
||||
" starting_stock_raw_beans,\n",
|
||||
" starting_stock_roasted_beans,\n",
|
||||
" starting_stock_decaff_beans, \n",
|
||||
" demand_generator_raw_beans,\n",
|
||||
" demand_generator_roasted_beans,\n",
|
||||
" demand_generator_decaff_beans,\n",
|
||||
" lead_time_generator_raw_beans, \n",
|
||||
" purchaser,\n",
|
||||
" production_line_switcher,\n",
|
||||
" roasted_beans_daily_production,\n",
|
||||
" decaff_beans_daily_production\n",
|
||||
" ):\n",
|
||||
" self.starting_stock_raw_beans = starting_stock_raw_beans\n",
|
||||
" self.starting_stock_roasted_beans = starting_stock_roasted_beans\n",
|
||||
" self.starting_stock_decaff_beans = starting_stock_decaff_beans\n",
|
||||
" self.demand_generator_raw_beans = demand_generator_raw_beans\n",
|
||||
" self.demand_generator_roasted_beans = demand_generator_roasted_beans\n",
|
||||
" self.demand_generator_decaff_beans = demand_generator_decaff_beans\n",
|
||||
" self.lead_time_generator_raw_beans = lead_time_generator_raw_beans\n",
|
||||
" self.purchaser = purchaser\n",
|
||||
" self.production_line_switcher = production_line_switcher\n",
|
||||
" self.roasted_beans_daily_production = roasted_beans_daily_production\n",
|
||||
" self.decaff_beans_daily_production = decaff_beans_daily_production\n",
|
||||
"\n",
|
||||
"class PurchaseOrder:\n",
|
||||
" \n",
|
||||
" def __init__(self, amount, request_date, delivery_date):\n",
|
||||
" self.amount = amount\n",
|
||||
" self.request_date = request_date\n",
|
||||
" self.delivery_date = delivery_date\n",
|
||||
"\n",
|
||||
" def __repr__(self):\n",
|
||||
" return f\"Order of {self.amount:.0f}, requested on {self.request_date}, delivery on {self.delivery_date}.\"\n",
|
||||
"\n",
|
||||
"class ProductionLine:\n",
|
||||
"\n",
|
||||
" def __init__(self, products_and_rates, starting_product=None):\n",
|
||||
" self.products_and_rates = products_and_rates\n",
|
||||
" self.on_the_line = starting_product\n",
|
||||
" self.next_on_the_line = None\n",
|
||||
" self.days_on_current_batch = 0\n",
|
||||
"\n",
|
||||
" def tick(self):\n",
|
||||
" if self.on_the_line in self.products_and_rates:\n",
|
||||
" self.days_on_current_batch += 1\n",
|
||||
" return self.products_and_rates[self.on_the_line]\n",
|
||||
"\n",
|
||||
" if self.on_the_line is None and self.next_on_the_line is None:\n",
|
||||
" self.days_on_current_batch += 1\n",
|
||||
" return 0\n",
|
||||
" if self.on_the_line is None:\n",
|
||||
" self.on_the_line = self.next_on_the_line\n",
|
||||
" self.next_on_the_line = None\n",
|
||||
" self.days_on_current_batch = 0\n",
|
||||
" return 0\n",
|
||||
" \n",
|
||||
" def switch_to_product(self, next_product):\n",
|
||||
" self.on_the_line = None\n",
|
||||
" self.next_on_the_line = next_product\n",
|
||||
" self.days_on_current_batch = -1\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class Simulation:\n",
|
||||
" \n",
|
||||
" def __init__(self, config: SimulationConfig, verbose=False):\n",
|
||||
" self._config = config\n",
|
||||
" self.verbose = verbose\n",
|
||||
"\n",
|
||||
" def run(self):\n",
|
||||
"\n",
|
||||
" stock_raw_beans = np.array([self._config.starting_stock_raw_beans])\n",
|
||||
" stock_roasted_beans = np.array([self._config.starting_stock_roasted_beans])\n",
|
||||
" stock_decaff_beans = np.array([self._config.starting_stock_decaff_beans])\n",
|
||||
"\n",
|
||||
" opened_orders = []\n",
|
||||
" ongoing_orders = {}\n",
|
||||
"\n",
|
||||
" demand_by_day_raw_beans = np.array(list())\n",
|
||||
" demand_by_day_roasted_beans = np.array(list())\n",
|
||||
" demand_by_day_decaff_beans = np.array(list())\n",
|
||||
"\n",
|
||||
" production_line = ProductionLine(\n",
|
||||
" products_and_rates={\n",
|
||||
" \"roasted_beans\": self._config.roasted_beans_daily_production,\n",
|
||||
" \"decaff_beans\": self._config.decaff_beans_daily_production\n",
|
||||
" },\n",
|
||||
" starting_product=\"roasted_beans\"\n",
|
||||
" )\n",
|
||||
"\n",
|
||||
" production_line_switcher = self._config.production_line_switcher\n",
|
||||
" \n",
|
||||
" for day in dates_in_2022:\n",
|
||||
"\n",
|
||||
" # General\n",
|
||||
" if self.verbose:\n",
|
||||
" print(\"-------------------------\")\n",
|
||||
" print(f\"Simulating day: {day}\")\n",
|
||||
" current_stock_raw_beans = stock_raw_beans[-1]\n",
|
||||
" current_stock_roasted_beans = stock_roasted_beans[-1]\n",
|
||||
" current_stock_decaff_beans = stock_decaff_beans[-1]\n",
|
||||
"\n",
|
||||
" # Generate demand\n",
|
||||
" if self.verbose:\n",
|
||||
" print(f\"Starting stock raw beans: {current_stock_raw_beans:.0f}\")\n",
|
||||
" print(f\"Starting stock roasted beans: {current_stock_roasted_beans:.0f}\")\n",
|
||||
" print(f\"Starting stock decaff beans: {current_stock_decaff_beans:.0f}\")\n",
|
||||
" demand_for_this_day_raw_beans = self._config.demand_generator_raw_beans()\n",
|
||||
" demand_for_this_day_roasted_beans = self._config.demand_generator_roasted_beans()\n",
|
||||
" demand_for_this_day_decaff_beans = self._config.demand_generator_decaff_beans()\n",
|
||||
" if self.verbose:\n",
|
||||
" print(f\"Generated raw beans demand for today: {demand_for_this_day_raw_beans:.0f}\")\n",
|
||||
" print(f\"Generated roasted beans demand for today: {demand_for_this_day_roasted_beans:.0f}\")\n",
|
||||
" print(f\"Generated decaff beans demand for today: {demand_for_this_day_decaff_beans:.0f}\")\n",
|
||||
" demand_by_day_raw_beans = np.append(demand_by_day_raw_beans, [demand_for_this_day_raw_beans])\n",
|
||||
" demand_by_day_roasted_beans = np.append(demand_by_day_roasted_beans, [demand_for_this_day_roasted_beans])\n",
|
||||
" demand_by_day_decaff_beans = np.append(demand_by_day_decaff_beans, [demand_for_this_day_decaff_beans])\n",
|
||||
"\n",
|
||||
"\n",
|
||||
" # Receive orders and place orders\n",
|
||||
" raw_beans_received_this_day = 0\n",
|
||||
" if day in ongoing_orders:\n",
|
||||
" order_delivered_today = ongoing_orders.pop(day)\n",
|
||||
" raw_beans_received_this_day = order_delivered_today.amount\n",
|
||||
" if self.verbose:\n",
|
||||
" print(f\"Raw beans received today: {raw_beans_received_this_day:.0f}\")\n",
|
||||
" \n",
|
||||
" order_to_make = self._config.purchaser(\n",
|
||||
" day, \n",
|
||||
" current_stock_raw_beans, \n",
|
||||
" ongoing_orders,\n",
|
||||
" self._config.lead_time_generator_raw_beans\n",
|
||||
" )\n",
|
||||
" if order_to_make:\n",
|
||||
" if self.verbose:\n",
|
||||
" print(f\"Placing a new order: {order_to_make}\")\n",
|
||||
" opened_orders.append(order_to_make)\n",
|
||||
" ongoing_orders[order_to_make.delivery_date] = order_to_make\n",
|
||||
"\n",
|
||||
"\n",
|
||||
" # Decide on production today and produce whatever gets produced or wait during the changeover\n",
|
||||
"\n",
|
||||
" print(f\"Product on the line: {production_line.on_the_line}\")\n",
|
||||
"\n",
|
||||
" production_line_switcher(\n",
|
||||
" production_line,\n",
|
||||
" {\n",
|
||||
" \"raw_beans_stock\": current_stock_raw_beans,\n",
|
||||
" \"roasted_beans_stock\": current_stock_roasted_beans,\n",
|
||||
" \"decaff_beans_stock\": current_stock_decaff_beans\n",
|
||||
" }\n",
|
||||
" )\n",
|
||||
"\n",
|
||||
" if production_line.on_the_line == \"roasted_beans\":\n",
|
||||
" roasted_beans_produced_this_day = production_line.tick()\n",
|
||||
" decaff_beans_produced_this_day = 0\n",
|
||||
" if production_line.on_the_line == \"decaff_beans\":\n",
|
||||
" roasted_beans_produced_this_day = 0\n",
|
||||
" decaff_beans_produced_this_day = production_line.tick()\n",
|
||||
" if production_line.on_the_line not in (\"roasted_beans\", \"decaff_beans\"):\n",
|
||||
" production_line.tick()\n",
|
||||
" roasted_beans_produced_this_day = 0\n",
|
||||
" decaff_beans_produced_this_day = 0\n",
|
||||
"\n",
|
||||
" raw_beans_consumed_in_production = roasted_beans_produced_this_day + decaff_beans_produced_this_day\n",
|
||||
" \n",
|
||||
" if self.verbose:\n",
|
||||
" print(f\"Roasted beans produced today: {roasted_beans_produced_this_day}\")\n",
|
||||
" print(f\"Decaff beans produced today: {decaff_beans_produced_this_day}\")\n",
|
||||
" print(f\"Product {production_line.on_the_line} has been on the line for {production_line.days_on_current_batch} days.\")\n",
|
||||
"\n",
|
||||
" # Update stocks with the changes of the day\n",
|
||||
"\n",
|
||||
" current_stock_raw_beans = (\n",
|
||||
" current_stock_raw_beans + \n",
|
||||
" raw_beans_received_this_day - \n",
|
||||
" demand_for_this_day_raw_beans -\n",
|
||||
" raw_beans_consumed_in_production\n",
|
||||
" )\n",
|
||||
" stock_raw_beans = np.append(stock_raw_beans, [current_stock_raw_beans])\n",
|
||||
" current_stock_roasted_beans = current_stock_roasted_beans + roasted_beans_produced_this_day - demand_for_this_day_roasted_beans\n",
|
||||
" stock_roasted_beans = np.append(stock_roasted_beans, [current_stock_roasted_beans])\n",
|
||||
" current_stock_decaff_beans = current_stock_decaff_beans + decaff_beans_produced_this_day - demand_for_this_day_decaff_beans\n",
|
||||
" stock_decaff_beans = np.append(stock_decaff_beans, [current_stock_decaff_beans])\n",
|
||||
" \n",
|
||||
" # Remove starting stock\n",
|
||||
" stock_raw_beans = np.delete(stock_raw_beans, 0) \n",
|
||||
" stock_roasted_beans = np.delete(stock_roasted_beans, 0)\n",
|
||||
" stock_decaff_beans = np.delete(stock_decaff_beans, 0)\n",
|
||||
" \n",
|
||||
" raw_beans_results = SimulationResult(\n",
|
||||
" stock_states=stock_raw_beans, \n",
|
||||
" demand_by_day=demand_by_day_raw_beans, \n",
|
||||
" sourcing_events=opened_orders\n",
|
||||
" )\n",
|
||||
" roasted_beans_results = SimulationResult(\n",
|
||||
" stock_states=stock_roasted_beans, \n",
|
||||
" demand_by_day=demand_by_day_roasted_beans, \n",
|
||||
" sourcing_events=None\n",
|
||||
" )\n",
|
||||
" decaff_beans_results = SimulationResult(\n",
|
||||
" stock_states=stock_decaff_beans, \n",
|
||||
" demand_by_day=demand_by_day_decaff_beans, \n",
|
||||
" sourcing_events=opened_orders\n",
|
||||
" )\n",
|
||||
"\n",
|
||||
"\n",
|
||||
" return raw_beans_results, roasted_beans_results, decaff_beans_results\n",
|
||||
" \n",
|
||||
"\n",
|
||||
"\n"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "cGcEzAIDfa8s"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"## Usage Example"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "Xul3y3LpYKiY"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# Read this block carefully to understand how to prepare parameters,\n",
|
||||
"# run simulations and fetch the results.\n",
|
||||
"\n",
|
||||
"# These are the steps we will follow:\n",
|
||||
"# 1. Prepare a purchaser function\n",
|
||||
"# 2. Prepare a production line management function\n",
|
||||
"# 3. Assemble a simulation configuration with your parameters and assumptions\n",
|
||||
"# 4. Run a simulation\n",
|
||||
"# 5. Fetch results\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"###\n",
|
||||
"# 1. Prepare a purchaser function\n",
|
||||
"###\n",
|
||||
"\n",
|
||||
"# The purchase function handles the decisions of whether to buy more raw coffee\n",
|
||||
"# beans to send to Diemen, and how much to buy. It gets called once per simulated\n",
|
||||
"# day, so you have an oportunity to place orders each day.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"# You can name your function whatever you like, but the arguments should have\n",
|
||||
"# the same names and order as show below.\n",
|
||||
"def a_simple_purchaser(\n",
|
||||
" day, # The current day\n",
|
||||
" current_stock, # The level of raw beans stock on that day\n",
|
||||
" ongoing_orders, # A dictionary with the open purchase orders\n",
|
||||
" lead_time_generator # The same lead time generator you pass to the Simulation Config\n",
|
||||
" ):\n",
|
||||
" # Your code goes here. You can make any logic you want. Just make sure to return\n",
|
||||
" # None if you don't want to place an order and to return a PurchaseOrder when\n",
|
||||
" # you want to buy. The policies below are a simple example to inspire you: you\n",
|
||||
" # definitely want to modify the numbers and/or followed logic.\n",
|
||||
" \n",
|
||||
" if ongoing_orders or current_stock > 15_000_000:\n",
|
||||
" # If we are already waiting for an order to arrive or we have enough stock\n",
|
||||
" # we don't request more goods.\n",
|
||||
" return None\n",
|
||||
"\n",
|
||||
" if current_stock <= 15_000_000:\n",
|
||||
" # If the stock is going low, we request more.\n",
|
||||
" return PurchaseOrder(\n",
|
||||
" amount=15_000_000, # The amount to order. This is the only bit you change.\n",
|
||||
" request_date=day, # Always copy paste this.\n",
|
||||
" delivery_date=day + timedelta(days=lead_time_generator()) # Always copy paste this.\n",
|
||||
" )\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"###\n",
|
||||
"# 2. Prepare a production line management function\n",
|
||||
"### \n",
|
||||
"\n",
|
||||
"# The line manager function handles the decision of whether the production line\n",
|
||||
"# should change to a different product (or no product at all). It gets called \n",
|
||||
"# once per day.\n",
|
||||
"\n",
|
||||
"# You can name your function whatever you like, but the arguments should have\n",
|
||||
"# the same names and order as show below.\n",
|
||||
"def a_simple_line_manager(\n",
|
||||
" production_line, # Details about the production line\n",
|
||||
" stock_by_product # A summary of the stock that updates each day\n",
|
||||
"):\n",
|
||||
" # Your code goes here. You can make any logic you want. Just make sure to \n",
|
||||
" # switch to None if you don't want to change the product on the line. If you want\n",
|
||||
" # to switch the product on the line, call production_line.switch_to_product(\"product name\"). \n",
|
||||
" # The policies below are a simple example to inspire you: you definitely want \n",
|
||||
" # to modify the numbers and/or followed logic.\n",
|
||||
" \n",
|
||||
" # If the current product has been less than 21 days on the line, we don't \n",
|
||||
" # change anything.\n",
|
||||
" if production_line.days_on_current_batch < 14:\n",
|
||||
" return\n",
|
||||
" \n",
|
||||
" if (\n",
|
||||
" stock_by_product[\"roasted_beans_stock\"] > 2_000_000 and \n",
|
||||
" stock_by_product[\"decaff_beans_stock\"] > 2_000_000 and\n",
|
||||
" production_line.on_the_line is not None\n",
|
||||
" ):\n",
|
||||
" # If we have plenty of stock and we are still producing, we stop the line\n",
|
||||
" # by switching to None.\n",
|
||||
" production_line.switch_to_product(None)\n",
|
||||
" print(\"Too much inventory. I'm switching to None!\")\n",
|
||||
" return\n",
|
||||
"\n",
|
||||
" if (\n",
|
||||
" stock_by_product[\"roasted_beans_stock\"] > 2_000_000 and \n",
|
||||
" stock_by_product[\"decaff_beans_stock\"] > 2_000_000 and\n",
|
||||
" production_line.on_the_line is None\n",
|
||||
" ):\n",
|
||||
" # If we have plenty of stock and we are stopped, we remain stopped.\n",
|
||||
" print(\"Too much inventory. Staying in None!\")\n",
|
||||
" return\n",
|
||||
"\n",
|
||||
" \n",
|
||||
" if (\n",
|
||||
" (\n",
|
||||
" max(stock_by_product[\"roasted_beans_stock\"], 1) / max(stock_by_product[\"decaff_beans_stock\"], 1) < 2\n",
|
||||
" ) and (\n",
|
||||
" production_line.on_the_line != \"roasted_beans\"\n",
|
||||
" )\n",
|
||||
" ):\n",
|
||||
" # If we are not producing roasted beans, and there is less than 2kg of roasted beans\n",
|
||||
" # for each kg of decaff beans in stock, we switch to roasted beans.\n",
|
||||
" production_line.switch_to_product(\"roasted_beans\")\n",
|
||||
" print(\"I'm switching to roasted!\")\n",
|
||||
" return\n",
|
||||
"\n",
|
||||
" if (\n",
|
||||
" (\n",
|
||||
" max(stock_by_product[\"roasted_beans_stock\"], 1) / max(stock_by_product[\"decaff_beans_stock\"], 1) > 2\n",
|
||||
" ) and (\n",
|
||||
" production_line.on_the_line != \"decaff_beans\"\n",
|
||||
" )\n",
|
||||
" ):\n",
|
||||
" # If we are not producing decaff beans, and there is more than 2kg of roasted beans\n",
|
||||
" # for each kg of decaff beans in stock, we switch to decaff beans.\n",
|
||||
" production_line.switch_to_product(\"decaff_beans\")\n",
|
||||
" print(\"I'm switching to decaff!\")\n",
|
||||
" return\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"###\n",
|
||||
"# 3. Assemble a simulation configuration\n",
|
||||
"### \n",
|
||||
"\n",
|
||||
"# In order to run as Simulation, you must prepare a config. The config allows \n",
|
||||
"# you to pass in your policies as well as to modify different parts of the \n",
|
||||
"# simulation so you can recreate reality accurately. You can find each argument\n",
|
||||
"# explained below.\n",
|
||||
"\n",
|
||||
"an_example_config = SimulationConfig(\n",
|
||||
" starting_stock_raw_beans=20_000_000, \n",
|
||||
" # ^ How many kgs of raw coffee beans does the warehouse start with.\n",
|
||||
" starting_stock_roasted_beans=1_000_000,\n",
|
||||
" # ^ How many kgs of roasted coffee beans does the warehouse start with. \n",
|
||||
" starting_stock_decaff_beans=500_000,\n",
|
||||
" # ^ How many kgs of decaff coffee beans does the warehouse start with.\n",
|
||||
" demand_generator_raw_beans=lambda: np.random.poisson(5/7) * np.random.normal(300_000, 50_000),\n",
|
||||
" # ^ A function that generates demand for raw beans. This gets called daily.\n",
|
||||
" # The return units should be kilograms.\n",
|
||||
" demand_generator_roasted_beans=lambda: np.random.poisson(4/7) * np.random.triangular(200_000, 250_000, 300_000),\n",
|
||||
" # ^ Same as above but for roasted beans.\n",
|
||||
" demand_generator_decaff_beans=lambda: np.random.poisson(1/7) * np.random.triangular(200_000, 250_000, 300_000),\n",
|
||||
" # ^ Same as above but for decaff beans.\n",
|
||||
" lead_time_generator_raw_beans=lambda: int(np.random.normal(30, 1)), \n",
|
||||
" # ^ A function that generates the lead times for ships going from Latin America\n",
|
||||
" # to Diemen. This gets called everytime you place an order to get more raw\n",
|
||||
" # beans. Should return an integer number of days. \n",
|
||||
" purchaser=a_simple_purchaser,\n",
|
||||
" # ^ Here you pass your purchasing policy function.\n",
|
||||
" production_line_switcher=a_simple_line_manager,\n",
|
||||
" # ^ Here you pass your production line management policy.\n",
|
||||
" roasted_beans_daily_production=250_000,\n",
|
||||
" # ^ The capacity of normal bean roasting, in kgs per day.\n",
|
||||
" decaff_beans_daily_production=150_000\n",
|
||||
" # ^ The capacity of decaff bean roasting, in kgs per day.\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"###\n",
|
||||
"# 4. Run a simulation\n",
|
||||
"###\n",
|
||||
"\n",
|
||||
"# The Simulation class is the code that actually runs a simulation. It takes a \n",
|
||||
"# SimulationConfig as an input, and returns a SimulationResult as an output.\n",
|
||||
"\n",
|
||||
"example_simulation = Simulation(\n",
|
||||
" config=an_example_config, # The config you build goes here\n",
|
||||
" verbose=True # This shows daily details. Turn to False if you don't want to see them.\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"# Let's run the simulation and store the results\n",
|
||||
"raw_results, roasted_results, decaff_results = example_simulation.run()\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"###\n",
|
||||
"# 5. Fetch results\n",
|
||||
"###\n",
|
||||
"\n",
|
||||
"# The simulation will provide you back with three SimulationResult variables, \n",
|
||||
"# one for each type of coffee bean. You can use this objects to make some quick\n",
|
||||
"# plots, and also to access the raw data about the stock and demand throughout\n",
|
||||
"# the simulation for each product.\n",
|
||||
"\n",
|
||||
"# In the next cells, you will find a few examples on how to explore these \n",
|
||||
"# results\n"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "cYHFWRrm3-ns"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"raw_results.plot_stock_history()\n",
|
||||
"roasted_results.plot_stock_history()\n",
|
||||
"decaff_results.plot_stock_history()"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "iXeAFhIp7848"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"raw_results.plot_stock_distribution()\n",
|
||||
"roasted_results.plot_stock_distribution()\n",
|
||||
"decaff_results.plot_stock_distribution()"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "RLRHLyVOiysH"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"for product, result in ((\"raw\", raw_results), (\"roasted\", roasted_results), (\"decaff\", decaff_results)):\n",
|
||||
" print(f\"{product} beans service level: {result.service_level()}\")\n",
|
||||
" print(f\"{product} beans mean stock: {result.mean_stock_level()}\")\n",
|
||||
" print(f\"{product} beans median stock: {result.median_stock_level()}\")\n",
|
||||
" print(f\"{product} beans stdev stock: {result.stdev_stock_level()}\")\n",
|
||||
" print(f\"{product} beans mean demand: {result.mean_demand()}\")"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "Cr-Txnk9jFJK"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"for product, result in ((\"raw\", raw_results), (\"roasted\", roasted_results), (\"decaff\", decaff_results)):\n",
|
||||
" print(f\"Daily stock distribution summary for {product} beans:\")\n",
|
||||
" print(result.stock_level_summary())"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "z1Ixv0bHqD65"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# Finally, you can access the raw data with the following attributes\n",
|
||||
"print(roasted_results.stock_states)\n",
|
||||
"print(roasted_results.demand_by_day)"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "-pw38uGpm-Aa"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"# Your turn\n",
|
||||
"\n",
|
||||
"Run the previous cells in order to load the required packages and code. Once you\n",
|
||||
"have done that, you can start building your own code below."
|
||||
],
|
||||
"metadata": {
|
||||
"id": "qSOiFi9OmgUR"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [],
|
||||
"metadata": {
|
||||
"id": "fOZ7KhC5rgYc"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
pds/cases/case_2/case_2.zip
Normal file
BIN
pds/cases/case_2/case_2.zip
Normal file
Binary file not shown.
689
pds/cases/case_2/case_2_student_notebook.ipynb
Normal file
689
pds/cases/case_2/case_2_student_notebook.ipynb
Normal file
|
|
@ -0,0 +1,689 @@
|
|||
{
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"name": "python3",
|
||||
"display_name": "Python 3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"# Case 2 - Student Notebook"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "oHWpkTqMeBMq"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"## Imports and data loading"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "BhR7Z_UqeEgm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "HQwlyagxfXRU"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import io\n",
|
||||
"import pandas as pd\n",
|
||||
"import numpy as np\n",
|
||||
"import seaborn as sns\n",
|
||||
"from google.colab import files\n",
|
||||
"from datetime import datetime, timedelta"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# This avoids scientific notation on millions and larger\n",
|
||||
"pd.set_option('display.float_format', lambda x: '%.2f' % x)"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "wsv3gEB9qmp6"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# Upload files from your computer here\n",
|
||||
"# Run the cell and click the \"Browse\" button to upload the provided CSV \n",
|
||||
"# files\n",
|
||||
"uploaded = files.upload()"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "4psao7htcAwr"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# Read the files as pandas dataframes and print them so you can check that the\n",
|
||||
"# process went fine\n",
|
||||
"\n",
|
||||
"served_orders = pd.read_csv(io.BytesIO(uploaded['served_orders.csv']))\n",
|
||||
"sourcing_events = pd.read_csv(io.BytesIO(uploaded['sourcing_events.csv']))\n",
|
||||
"\n",
|
||||
"for table in (served_orders, sourcing_events):\n",
|
||||
" print(table.head())"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "X8N0PZ4qcOls"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"## Analysis"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "GKty74ZfuBEG"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# You can use this space to analyse the provided data as you see fit."
|
||||
],
|
||||
"metadata": {
|
||||
"id": "CuYSBC2auDIG"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"## Provided code\n"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "KM5HVJiIfYPC"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# This cell includes provided code to run simulations.\n",
|
||||
"# You do not need to understand the internals of this code. Feel free to just\n",
|
||||
"# run it and move forward.\n",
|
||||
"# The next section explains how you can call this code to run your simulations.\n",
|
||||
"\n",
|
||||
"base = datetime(2022,1,1)\n",
|
||||
"dates_in_2022 = [base + timedelta(days=x) for x in range(365)]\n",
|
||||
"\n",
|
||||
"class SimulationResult:\n",
|
||||
"\n",
|
||||
" def __init__(self, stock_states, demand_by_day, sourcing_events):\n",
|
||||
" self.stock_states = stock_states\n",
|
||||
" self.demand_by_day = demand_by_day\n",
|
||||
" self.sourcing_events = sourcing_events\n",
|
||||
"\n",
|
||||
" def plot_stock_history(self):\n",
|
||||
" sns.lineplot(x=dates_in_2022, y=self.stock_states)\n",
|
||||
"\n",
|
||||
" def plot_stock_distribution(self):\n",
|
||||
" sns.histplot(x=self.stock_states, kde=True)\n",
|
||||
"\n",
|
||||
" def service_level(self):\n",
|
||||
" return (self.stock_states > 0 ).astype(int).mean()\n",
|
||||
"\n",
|
||||
" def stock_level_summary(self):\n",
|
||||
" print(\n",
|
||||
" pd.DataFrame(self.stock_states).describe()\n",
|
||||
" ) \n",
|
||||
" \n",
|
||||
" def mean_stock_level(self):\n",
|
||||
" return self.stock_states.mean()\n",
|
||||
"\n",
|
||||
" def median_stock_level(self):\n",
|
||||
" return np.median(self.stock_states)\n",
|
||||
"\n",
|
||||
" def stdev_stock_level(self):\n",
|
||||
" return self.stock_states.std()\n",
|
||||
"\n",
|
||||
" def mean_demand(self):\n",
|
||||
" return self.demand_by_day.mean()\n",
|
||||
" \n",
|
||||
" def number_of_purchase_orders_placed(self):\n",
|
||||
" return len(self.sourcing_events)\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class SimulationConfig:\n",
|
||||
"\n",
|
||||
" def __init__(\n",
|
||||
" self, \n",
|
||||
" starting_stock_raw_beans,\n",
|
||||
" starting_stock_roasted_beans,\n",
|
||||
" starting_stock_decaff_beans, \n",
|
||||
" demand_generator_raw_beans,\n",
|
||||
" demand_generator_roasted_beans,\n",
|
||||
" demand_generator_decaff_beans,\n",
|
||||
" lead_time_generator_raw_beans, \n",
|
||||
" purchaser,\n",
|
||||
" production_line_switcher,\n",
|
||||
" roasted_beans_daily_production,\n",
|
||||
" decaff_beans_daily_production\n",
|
||||
" ):\n",
|
||||
" self.starting_stock_raw_beans = starting_stock_raw_beans\n",
|
||||
" self.starting_stock_roasted_beans = starting_stock_roasted_beans\n",
|
||||
" self.starting_stock_decaff_beans = starting_stock_decaff_beans\n",
|
||||
" self.demand_generator_raw_beans = demand_generator_raw_beans\n",
|
||||
" self.demand_generator_roasted_beans = demand_generator_roasted_beans\n",
|
||||
" self.demand_generator_decaff_beans = demand_generator_decaff_beans\n",
|
||||
" self.lead_time_generator_raw_beans = lead_time_generator_raw_beans\n",
|
||||
" self.purchaser = purchaser\n",
|
||||
" self.production_line_switcher = production_line_switcher\n",
|
||||
" self.roasted_beans_daily_production = roasted_beans_daily_production\n",
|
||||
" self.decaff_beans_daily_production = decaff_beans_daily_production\n",
|
||||
"\n",
|
||||
"class PurchaseOrder:\n",
|
||||
" \n",
|
||||
" def __init__(self, amount, request_date, delivery_date):\n",
|
||||
" self.amount = amount\n",
|
||||
" self.request_date = request_date\n",
|
||||
" self.delivery_date = delivery_date\n",
|
||||
"\n",
|
||||
" def __repr__(self):\n",
|
||||
" return f\"Order of {self.amount:.0f}, requested on {self.request_date}, delivery on {self.delivery_date}.\"\n",
|
||||
"\n",
|
||||
"class ProductionLine:\n",
|
||||
"\n",
|
||||
" def __init__(self, products_and_rates, starting_product=None):\n",
|
||||
" self.products_and_rates = products_and_rates\n",
|
||||
" self.on_the_line = starting_product\n",
|
||||
" self.next_on_the_line = None\n",
|
||||
" self.days_on_current_batch = 0\n",
|
||||
"\n",
|
||||
" def tick(self):\n",
|
||||
" if self.on_the_line in self.products_and_rates:\n",
|
||||
" self.days_on_current_batch += 1\n",
|
||||
" return self.products_and_rates[self.on_the_line]\n",
|
||||
"\n",
|
||||
" if self.on_the_line is None and self.next_on_the_line is None:\n",
|
||||
" self.days_on_current_batch += 1\n",
|
||||
" return 0\n",
|
||||
" if self.on_the_line is None:\n",
|
||||
" self.on_the_line = self.next_on_the_line\n",
|
||||
" self.next_on_the_line = None\n",
|
||||
" self.days_on_current_batch = 0\n",
|
||||
" return 0\n",
|
||||
" \n",
|
||||
" def switch_to_product(self, next_product):\n",
|
||||
" self.on_the_line = None\n",
|
||||
" self.next_on_the_line = next_product\n",
|
||||
" self.days_on_current_batch = -1\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class Simulation:\n",
|
||||
" \n",
|
||||
" def __init__(self, config: SimulationConfig, verbose=False):\n",
|
||||
" self._config = config\n",
|
||||
" self.verbose = verbose\n",
|
||||
"\n",
|
||||
" def run(self):\n",
|
||||
"\n",
|
||||
" stock_raw_beans = np.array([self._config.starting_stock_raw_beans])\n",
|
||||
" stock_roasted_beans = np.array([self._config.starting_stock_roasted_beans])\n",
|
||||
" stock_decaff_beans = np.array([self._config.starting_stock_decaff_beans])\n",
|
||||
"\n",
|
||||
" opened_orders = []\n",
|
||||
" ongoing_orders = {}\n",
|
||||
"\n",
|
||||
" demand_by_day_raw_beans = np.array(list())\n",
|
||||
" demand_by_day_roasted_beans = np.array(list())\n",
|
||||
" demand_by_day_decaff_beans = np.array(list())\n",
|
||||
"\n",
|
||||
" production_line = ProductionLine(\n",
|
||||
" products_and_rates={\n",
|
||||
" \"roasted_beans\": self._config.roasted_beans_daily_production,\n",
|
||||
" \"decaff_beans\": self._config.decaff_beans_daily_production\n",
|
||||
" },\n",
|
||||
" starting_product=\"roasted_beans\"\n",
|
||||
" )\n",
|
||||
"\n",
|
||||
" production_line_switcher = self._config.production_line_switcher\n",
|
||||
" \n",
|
||||
" for day in dates_in_2022:\n",
|
||||
"\n",
|
||||
" # General\n",
|
||||
" if self.verbose:\n",
|
||||
" print(\"-------------------------\")\n",
|
||||
" print(f\"Simulating day: {day}\")\n",
|
||||
" current_stock_raw_beans = stock_raw_beans[-1]\n",
|
||||
" current_stock_roasted_beans = stock_roasted_beans[-1]\n",
|
||||
" current_stock_decaff_beans = stock_decaff_beans[-1]\n",
|
||||
"\n",
|
||||
" # Generate demand\n",
|
||||
" if self.verbose:\n",
|
||||
" print(f\"Starting stock raw beans: {current_stock_raw_beans:.0f}\")\n",
|
||||
" print(f\"Starting stock roasted beans: {current_stock_roasted_beans:.0f}\")\n",
|
||||
" print(f\"Starting stock decaff beans: {current_stock_decaff_beans:.0f}\")\n",
|
||||
" demand_for_this_day_raw_beans = self._config.demand_generator_raw_beans()\n",
|
||||
" demand_for_this_day_roasted_beans = self._config.demand_generator_roasted_beans()\n",
|
||||
" demand_for_this_day_decaff_beans = self._config.demand_generator_decaff_beans()\n",
|
||||
" if self.verbose:\n",
|
||||
" print(f\"Generated raw beans demand for today: {demand_for_this_day_raw_beans:.0f}\")\n",
|
||||
" print(f\"Generated roasted beans demand for today: {demand_for_this_day_roasted_beans:.0f}\")\n",
|
||||
" print(f\"Generated decaff beans demand for today: {demand_for_this_day_decaff_beans:.0f}\")\n",
|
||||
" demand_by_day_raw_beans = np.append(demand_by_day_raw_beans, [demand_for_this_day_raw_beans])\n",
|
||||
" demand_by_day_roasted_beans = np.append(demand_by_day_roasted_beans, [demand_for_this_day_roasted_beans])\n",
|
||||
" demand_by_day_decaff_beans = np.append(demand_by_day_decaff_beans, [demand_for_this_day_decaff_beans])\n",
|
||||
"\n",
|
||||
"\n",
|
||||
" # Receive orders and place orders\n",
|
||||
" raw_beans_received_this_day = 0\n",
|
||||
" if day in ongoing_orders:\n",
|
||||
" order_delivered_today = ongoing_orders.pop(day)\n",
|
||||
" raw_beans_received_this_day = order_delivered_today.amount\n",
|
||||
" if self.verbose:\n",
|
||||
" print(f\"Raw beans received today: {raw_beans_received_this_day:.0f}\")\n",
|
||||
" \n",
|
||||
" order_to_make = self._config.purchaser(\n",
|
||||
" day, \n",
|
||||
" current_stock_raw_beans, \n",
|
||||
" ongoing_orders,\n",
|
||||
" self._config.lead_time_generator_raw_beans\n",
|
||||
" )\n",
|
||||
" if order_to_make:\n",
|
||||
" if self.verbose:\n",
|
||||
" print(f\"Placing a new order: {order_to_make}\")\n",
|
||||
" opened_orders.append(order_to_make)\n",
|
||||
" ongoing_orders[order_to_make.delivery_date] = order_to_make\n",
|
||||
"\n",
|
||||
"\n",
|
||||
" # Decide on production today and produce whatever gets produced or wait during the changeover\n",
|
||||
"\n",
|
||||
" print(f\"Product on the line: {production_line.on_the_line}\")\n",
|
||||
"\n",
|
||||
" production_line_switcher(\n",
|
||||
" production_line,\n",
|
||||
" {\n",
|
||||
" \"raw_beans_stock\": current_stock_raw_beans,\n",
|
||||
" \"roasted_beans_stock\": current_stock_roasted_beans,\n",
|
||||
" \"decaff_beans_stock\": current_stock_decaff_beans\n",
|
||||
" }\n",
|
||||
" )\n",
|
||||
"\n",
|
||||
" if production_line.on_the_line == \"roasted_beans\":\n",
|
||||
" roasted_beans_produced_this_day = production_line.tick()\n",
|
||||
" decaff_beans_produced_this_day = 0\n",
|
||||
" if production_line.on_the_line == \"decaff_beans\":\n",
|
||||
" roasted_beans_produced_this_day = 0\n",
|
||||
" decaff_beans_produced_this_day = production_line.tick()\n",
|
||||
" if production_line.on_the_line not in (\"roasted_beans\", \"decaff_beans\"):\n",
|
||||
" production_line.tick()\n",
|
||||
" roasted_beans_produced_this_day = 0\n",
|
||||
" decaff_beans_produced_this_day = 0\n",
|
||||
"\n",
|
||||
" raw_beans_consumed_in_production = roasted_beans_produced_this_day + decaff_beans_produced_this_day\n",
|
||||
" \n",
|
||||
" if self.verbose:\n",
|
||||
" print(f\"Roasted beans produced today: {roasted_beans_produced_this_day}\")\n",
|
||||
" print(f\"Decaff beans produced today: {decaff_beans_produced_this_day}\")\n",
|
||||
" print(f\"Product {production_line.on_the_line} has been on the line for {production_line.days_on_current_batch} days.\")\n",
|
||||
"\n",
|
||||
" # Update stocks with the changes of the day\n",
|
||||
"\n",
|
||||
" current_stock_raw_beans = (\n",
|
||||
" current_stock_raw_beans + \n",
|
||||
" raw_beans_received_this_day - \n",
|
||||
" demand_for_this_day_raw_beans -\n",
|
||||
" raw_beans_consumed_in_production\n",
|
||||
" )\n",
|
||||
" stock_raw_beans = np.append(stock_raw_beans, [current_stock_raw_beans])\n",
|
||||
" current_stock_roasted_beans = current_stock_roasted_beans + roasted_beans_produced_this_day - demand_for_this_day_roasted_beans\n",
|
||||
" stock_roasted_beans = np.append(stock_roasted_beans, [current_stock_roasted_beans])\n",
|
||||
" current_stock_decaff_beans = current_stock_decaff_beans + decaff_beans_produced_this_day - demand_for_this_day_decaff_beans\n",
|
||||
" stock_decaff_beans = np.append(stock_decaff_beans, [current_stock_decaff_beans])\n",
|
||||
" \n",
|
||||
" # Remove starting stock\n",
|
||||
" stock_raw_beans = np.delete(stock_raw_beans, 0) \n",
|
||||
" stock_roasted_beans = np.delete(stock_roasted_beans, 0)\n",
|
||||
" stock_decaff_beans = np.delete(stock_decaff_beans, 0)\n",
|
||||
" \n",
|
||||
" raw_beans_results = SimulationResult(\n",
|
||||
" stock_states=stock_raw_beans, \n",
|
||||
" demand_by_day=demand_by_day_raw_beans, \n",
|
||||
" sourcing_events=opened_orders\n",
|
||||
" )\n",
|
||||
" roasted_beans_results = SimulationResult(\n",
|
||||
" stock_states=stock_roasted_beans, \n",
|
||||
" demand_by_day=demand_by_day_roasted_beans, \n",
|
||||
" sourcing_events=None\n",
|
||||
" )\n",
|
||||
" decaff_beans_results = SimulationResult(\n",
|
||||
" stock_states=stock_decaff_beans, \n",
|
||||
" demand_by_day=demand_by_day_decaff_beans, \n",
|
||||
" sourcing_events=opened_orders\n",
|
||||
" )\n",
|
||||
"\n",
|
||||
"\n",
|
||||
" return raw_beans_results, roasted_beans_results, decaff_beans_results\n",
|
||||
" \n",
|
||||
"\n",
|
||||
"\n"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "cGcEzAIDfa8s"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"## Usage Example"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "Xul3y3LpYKiY"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# Read this block carefully to understand how to prepare parameters,\n",
|
||||
"# run simulations and fetch the results.\n",
|
||||
"\n",
|
||||
"# These are the steps we will follow:\n",
|
||||
"# 1. Prepare a purchaser function\n",
|
||||
"# 2. Prepare a production line management function\n",
|
||||
"# 3. Assemble a simulation configuration with your parameters and assumptions\n",
|
||||
"# 4. Run a simulation\n",
|
||||
"# 5. Fetch results\n",
|
||||
"\n",
|
||||
"# AN IMPORTANT NOTE: all numbers in this example are random. You will most \n",
|
||||
"# surely have to modify them and fit them to the info and data that has been\n",
|
||||
"# provided to you.\n",
|
||||
"\n",
|
||||
"###\n",
|
||||
"# 1. Prepare a purchaser function\n",
|
||||
"###\n",
|
||||
"\n",
|
||||
"# The purchase function handles the decisions of whether to buy more raw coffee\n",
|
||||
"# beans to send to Diemen, and how much to buy. It gets called once per simulated\n",
|
||||
"# day, so you have an oportunity to place orders each day.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"# You can name your function whatever you like, but the arguments should have\n",
|
||||
"# the same names and order as show below.\n",
|
||||
"def a_simple_purchaser(\n",
|
||||
" day, # The current day\n",
|
||||
" current_stock, # The level of raw beans stock on that day\n",
|
||||
" ongoing_orders, # A dictionary with the open purchase orders\n",
|
||||
" lead_time_generator # The same lead time generator you pass to the Simulation Config\n",
|
||||
" ):\n",
|
||||
" # Your code goes here. You can make any logic you want. Just make sure to return\n",
|
||||
" # None if you don't want to place an order and to return a PurchaseOrder when\n",
|
||||
" # you want to buy. The policies below are a simple example to inspire you: you\n",
|
||||
" # definitely want to modify the numbers and/or followed logic.\n",
|
||||
" \n",
|
||||
" if ongoing_orders or current_stock > 15_000_000:\n",
|
||||
" # If we are already waiting for an order to arrive or we have enough stock\n",
|
||||
" # we don't request more goods.\n",
|
||||
" return None\n",
|
||||
"\n",
|
||||
" if current_stock <= 15_000_000:\n",
|
||||
" # If the stock is going low, we request more.\n",
|
||||
" return PurchaseOrder(\n",
|
||||
" amount=15_000_000, # The amount to order. This is the only bit you change.\n",
|
||||
" request_date=day, # Always copy paste this.\n",
|
||||
" delivery_date=day + timedelta(days=lead_time_generator()) # Always copy paste this.\n",
|
||||
" )\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"###\n",
|
||||
"# 2. Prepare a production line management function\n",
|
||||
"### \n",
|
||||
"\n",
|
||||
"# The line manager function handles the decision of whether the production line\n",
|
||||
"# should change to a different product (or no product at all). It gets called \n",
|
||||
"# once per day.\n",
|
||||
"\n",
|
||||
"# You can name your function whatever you like, but the arguments should have\n",
|
||||
"# the same names and order as show below.\n",
|
||||
"def a_simple_line_manager(\n",
|
||||
" production_line, # Details about the production line\n",
|
||||
" stock_by_product # A summary of the stock that updates each day\n",
|
||||
"):\n",
|
||||
" # Your code goes here. You can make any logic you want. Just make sure to \n",
|
||||
" # switch to None if you don't want to change the product on the line. If you want\n",
|
||||
" # to switch the product on the line, call production_line.switch_to_product(\"product name\"). \n",
|
||||
" # The policies below are a simple example to inspire you: you definitely want \n",
|
||||
" # to modify the numbers and/or followed logic.\n",
|
||||
" \n",
|
||||
" # If the current product has been less than 21 days on the line, we don't \n",
|
||||
" # change anything.\n",
|
||||
" if production_line.days_on_current_batch < 14:\n",
|
||||
" return\n",
|
||||
" \n",
|
||||
" if (\n",
|
||||
" stock_by_product[\"roasted_beans_stock\"] > 2_000_000 and \n",
|
||||
" stock_by_product[\"decaff_beans_stock\"] > 2_000_000 and\n",
|
||||
" production_line.on_the_line is not None\n",
|
||||
" ):\n",
|
||||
" # If we have plenty of stock and we are still producing, we stop the line\n",
|
||||
" # by switching to None.\n",
|
||||
" production_line.switch_to_product(None)\n",
|
||||
" print(\"Too much inventory. I'm switching to None!\")\n",
|
||||
" return\n",
|
||||
"\n",
|
||||
" if (\n",
|
||||
" stock_by_product[\"roasted_beans_stock\"] > 2_000_000 and \n",
|
||||
" stock_by_product[\"decaff_beans_stock\"] > 2_000_000 and\n",
|
||||
" production_line.on_the_line is None\n",
|
||||
" ):\n",
|
||||
" # If we have plenty of stock and we are stopped, we remain stopped.\n",
|
||||
" print(\"Too much inventory. Staying in None!\")\n",
|
||||
" return\n",
|
||||
"\n",
|
||||
" \n",
|
||||
" if (\n",
|
||||
" (\n",
|
||||
" max(stock_by_product[\"roasted_beans_stock\"], 1) / max(stock_by_product[\"decaff_beans_stock\"], 1) < 2\n",
|
||||
" ) and (\n",
|
||||
" production_line.on_the_line != \"roasted_beans\"\n",
|
||||
" )\n",
|
||||
" ):\n",
|
||||
" # If we are not producing roasted beans, and there is less than 2kg of roasted beans\n",
|
||||
" # for each kg of decaff beans in stock, we switch to roasted beans.\n",
|
||||
" production_line.switch_to_product(\"roasted_beans\")\n",
|
||||
" print(\"I'm switching to roasted!\")\n",
|
||||
" return\n",
|
||||
"\n",
|
||||
" if (\n",
|
||||
" (\n",
|
||||
" max(stock_by_product[\"roasted_beans_stock\"], 1) / max(stock_by_product[\"decaff_beans_stock\"], 1) > 2\n",
|
||||
" ) and (\n",
|
||||
" production_line.on_the_line != \"decaff_beans\"\n",
|
||||
" )\n",
|
||||
" ):\n",
|
||||
" # If we are not producing decaff beans, and there is more than 2kg of roasted beans\n",
|
||||
" # for each kg of decaff beans in stock, we switch to decaff beans.\n",
|
||||
" production_line.switch_to_product(\"decaff_beans\")\n",
|
||||
" print(\"I'm switching to decaff!\")\n",
|
||||
" return\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"###\n",
|
||||
"# 3. Assemble a simulation configuration\n",
|
||||
"### \n",
|
||||
"\n",
|
||||
"# In order to run as Simulation, you must prepare a config. The config allows \n",
|
||||
"# you to pass in your policies as well as to modify different parts of the \n",
|
||||
"# simulation so you can recreate reality accurately. You can find each argument\n",
|
||||
"# explained below.\n",
|
||||
"\n",
|
||||
"an_example_config = SimulationConfig(\n",
|
||||
" starting_stock_raw_beans=20_000, \n",
|
||||
" # ^ How many kgs of raw coffee beans does the warehouse start with.\n",
|
||||
" starting_stock_roasted_beans=1_000,\n",
|
||||
" # ^ How many kgs of roasted coffee beans does the warehouse start with. \n",
|
||||
" starting_stock_decaff_beans=500,\n",
|
||||
" # ^ How many kgs of decaff coffee beans does the warehouse start with.\n",
|
||||
" demand_generator_raw_beans=lambda: np.random.poisson(12/7) * np.random.normal(300, 50),\n",
|
||||
" # ^ A function that generates demand for raw beans. This gets called daily.\n",
|
||||
" # The return units should be kilograms.\n",
|
||||
" demand_generator_roasted_beans=lambda: np.random.poisson(2/7) * np.random.triangular(200, 250, 300),\n",
|
||||
" # ^ Same as above but for roasted beans.\n",
|
||||
" demand_generator_decaff_beans=lambda: np.random.poisson(2/7) * np.random.triangular(200, 250, 300),\n",
|
||||
" # ^ Same as above but for decaff beans.\n",
|
||||
" lead_time_generator_raw_beans=lambda: int(np.random.normal(10, 1)), \n",
|
||||
" # ^ A function that generates the lead times for ships going from Latin America\n",
|
||||
" # to Diemen. This gets called everytime you place an order to get more raw\n",
|
||||
" # beans. Should return an integer number of days. \n",
|
||||
" purchaser=a_simple_purchaser,\n",
|
||||
" # ^ Here you pass your purchasing policy function.\n",
|
||||
" production_line_switcher=a_simple_line_manager,\n",
|
||||
" # ^ Here you pass your production line management policy.\n",
|
||||
" roasted_beans_daily_production=400,\n",
|
||||
" # ^ The capacity of normal bean roasting, in kgs per day.\n",
|
||||
" decaff_beans_daily_production=400\n",
|
||||
" # ^ The capacity of decaff bean roasting, in kgs per day.\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"###\n",
|
||||
"# 4. Run a simulation\n",
|
||||
"###\n",
|
||||
"\n",
|
||||
"# The Simulation class is the code that actually runs a simulation. It takes a \n",
|
||||
"# SimulationConfig as an input, and returns a SimulationResult as an output.\n",
|
||||
"\n",
|
||||
"example_simulation = Simulation(\n",
|
||||
" config=an_example_config, # The config you build goes here\n",
|
||||
" verbose=True # This shows daily details. Turn to False if you don't want to see them.\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"# Let's run the simulation and store the results\n",
|
||||
"raw_results, roasted_results, decaff_results = example_simulation.run()\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"###\n",
|
||||
"# 5. Fetch results\n",
|
||||
"###\n",
|
||||
"\n",
|
||||
"# The simulation will provide you back with three SimulationResult variables, \n",
|
||||
"# one for each type of coffee bean. You can use this objects to make some quick\n",
|
||||
"# plots, and also to access the raw data about the stock and demand throughout\n",
|
||||
"# the simulation for each product.\n",
|
||||
"\n",
|
||||
"# In the next cells, you will find a few examples on how to explore these \n",
|
||||
"# results\n"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "cYHFWRrm3-ns"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"raw_results.plot_stock_history()\n",
|
||||
"roasted_results.plot_stock_history()\n",
|
||||
"decaff_results.plot_stock_history()"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "iXeAFhIp7848"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"raw_results.plot_stock_distribution()\n",
|
||||
"roasted_results.plot_stock_distribution()\n",
|
||||
"decaff_results.plot_stock_distribution()"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "RLRHLyVOiysH"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"for product, result in ((\"raw\", raw_results), (\"roasted\", roasted_results), (\"decaff\", decaff_results)):\n",
|
||||
" print(f\"{product} beans service level: {result.service_level()}\")\n",
|
||||
" print(f\"{product} beans mean stock: {result.mean_stock_level()}\")\n",
|
||||
" print(f\"{product} beans median stock: {result.median_stock_level()}\")\n",
|
||||
" print(f\"{product} beans stdev stock: {result.stdev_stock_level()}\")\n",
|
||||
" print(f\"{product} beans mean demand: {result.mean_demand()}\")"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "Cr-Txnk9jFJK"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"for product, result in ((\"raw\", raw_results), (\"roasted\", roasted_results), (\"decaff\", decaff_results)):\n",
|
||||
" print(f\"Daily stock distribution summary for {product} beans:\")\n",
|
||||
" print(result.stock_level_summary())"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "z1Ixv0bHqD65"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# Finally, you can access the raw data with the following attributes\n",
|
||||
"print(roasted_results.stock_states)\n",
|
||||
"print(roasted_results.demand_by_day)"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "-pw38uGpm-Aa"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"# Your turn\n",
|
||||
"\n",
|
||||
"Run the previous cells in order to load the required packages and code. Once you\n",
|
||||
"have done that, you can start building your own code below."
|
||||
],
|
||||
"metadata": {
|
||||
"id": "qSOiFi9OmgUR"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [],
|
||||
"metadata": {
|
||||
"id": "fOZ7KhC5rgYc"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
pds/cases/case_2/grading.xlsx
Normal file
BIN
pds/cases/case_2/grading.xlsx
Normal file
Binary file not shown.
BIN
pds/cases/case_2/grading_team_1.xlsx
Normal file
BIN
pds/cases/case_2/grading_team_1.xlsx
Normal file
Binary file not shown.
BIN
pds/cases/case_2/grading_team_2.xlsx
Normal file
BIN
pds/cases/case_2/grading_team_2.xlsx
Normal file
Binary file not shown.
BIN
pds/cases/case_2/grading_team_3.xlsx
Normal file
BIN
pds/cases/case_2/grading_team_3.xlsx
Normal file
Binary file not shown.
BIN
pds/cases/case_2/grading_team_4.xlsx
Normal file
BIN
pds/cases/case_2/grading_team_4.xlsx
Normal file
Binary file not shown.
BIN
pds/cases/case_2/grading_team_4_comments_reviewd.xlsx
Normal file
BIN
pds/cases/case_2/grading_team_4_comments_reviewd.xlsx
Normal file
Binary file not shown.
BIN
pds/cases/case_2/grading_team_5.xlsx
Normal file
BIN
pds/cases/case_2/grading_team_5.xlsx
Normal file
Binary file not shown.
508
pds/cases/case_2/served_orders.csv
Normal file
508
pds/cases/case_2/served_orders.csv
Normal file
|
|
@ -0,0 +1,508 @@
|
|||
date,amount
|
||||
2021-01-01,326717
|
||||
2021-01-02,275529
|
||||
2021-01-03,389027
|
||||
2021-01-04,362822
|
||||
2021-01-05,347345
|
||||
2021-01-06,345372
|
||||
2021-01-08,275213
|
||||
2021-01-09,241112
|
||||
2021-01-11,299890
|
||||
2021-01-12,302046
|
||||
2021-01-13,337515
|
||||
2021-01-14,300098
|
||||
2021-01-15,316018
|
||||
2021-01-16,287948
|
||||
2021-01-17,274375
|
||||
2021-01-19,286417
|
||||
2021-01-20,348557
|
||||
2021-01-23,301051
|
||||
2021-01-24,311603
|
||||
2021-01-25,236287
|
||||
2021-01-26,210067
|
||||
2021-01-27,228554
|
||||
2021-01-28,211761
|
||||
2021-01-29,243355
|
||||
2021-01-30,319297
|
||||
2021-01-31,307556
|
||||
2021-02-01,361433
|
||||
2021-02-02,156577
|
||||
2021-02-03,366125
|
||||
2021-02-04,250933
|
||||
2021-02-06,295484
|
||||
2021-02-07,348856
|
||||
2021-02-08,309115
|
||||
2021-02-09,330372
|
||||
2021-02-11,244318
|
||||
2021-02-13,306637
|
||||
2021-02-15,288287
|
||||
2021-02-17,235796
|
||||
2021-02-19,277708
|
||||
2021-02-20,261709
|
||||
2021-02-21,282469
|
||||
2021-02-22,308186
|
||||
2021-02-23,262888
|
||||
2021-02-24,328054
|
||||
2021-02-25,270879
|
||||
2021-02-26,274060
|
||||
2021-02-27,336799
|
||||
2021-02-28,405675
|
||||
2021-03-01,304497
|
||||
2021-03-02,404511
|
||||
2021-03-03,306753
|
||||
2021-03-05,280310
|
||||
2021-03-07,316546
|
||||
2021-03-08,353061
|
||||
2021-03-10,302688
|
||||
2021-03-11,335184
|
||||
2021-03-13,329087
|
||||
2021-03-14,342549
|
||||
2021-03-15,274529
|
||||
2021-03-17,301187
|
||||
2021-03-18,301054
|
||||
2021-03-19,298410
|
||||
2021-03-20,360782
|
||||
2021-03-21,238877
|
||||
2021-03-22,448062
|
||||
2021-03-23,325327
|
||||
2021-03-24,274940
|
||||
2021-03-25,348203
|
||||
2021-03-28,341127
|
||||
2021-03-29,239224
|
||||
2021-03-31,210169
|
||||
2021-04-03,401641
|
||||
2021-04-04,307472
|
||||
2021-04-07,287169
|
||||
2021-04-08,261859
|
||||
2021-04-10,262021
|
||||
2021-04-11,280504
|
||||
2021-04-13,267181
|
||||
2021-04-14,271747
|
||||
2021-04-15,280964
|
||||
2021-04-16,374444
|
||||
2021-04-17,308427
|
||||
2021-04-18,297192
|
||||
2021-04-19,245591
|
||||
2021-04-20,257421
|
||||
2021-04-21,215640
|
||||
2021-04-22,351177
|
||||
2021-04-24,283042
|
||||
2021-04-25,274782
|
||||
2021-04-26,293927
|
||||
2021-04-27,208290
|
||||
2021-04-28,350390
|
||||
2021-04-30,247523
|
||||
2021-05-01,235533
|
||||
2021-05-04,340665
|
||||
2021-05-05,309549
|
||||
2021-05-06,273190
|
||||
2021-05-08,351836
|
||||
2021-05-10,262566
|
||||
2021-05-11,306779
|
||||
2021-05-13,294170
|
||||
2021-05-15,320050
|
||||
2021-05-16,282865
|
||||
2021-05-18,290425
|
||||
2021-05-19,350460
|
||||
2021-05-20,344342
|
||||
2021-05-21,342156
|
||||
2021-05-22,323964
|
||||
2021-05-23,267025
|
||||
2021-05-24,277235
|
||||
2021-05-25,296506
|
||||
2021-05-26,237995
|
||||
2021-05-27,263647
|
||||
2021-05-28,270969
|
||||
2021-05-30,225607
|
||||
2021-06-01,335635
|
||||
2021-06-02,283243
|
||||
2021-06-03,286625
|
||||
2021-06-04,277667
|
||||
2021-06-05,295206
|
||||
2021-06-07,294017
|
||||
2021-06-08,293425
|
||||
2021-06-09,235027
|
||||
2021-06-10,198216
|
||||
2021-06-13,310663
|
||||
2021-06-17,331789
|
||||
2021-06-20,265635
|
||||
2021-06-21,224847
|
||||
2021-06-22,263459
|
||||
2021-06-24,288901
|
||||
2021-06-25,285640
|
||||
2021-06-26,377020
|
||||
2021-06-27,264235
|
||||
2021-06-29,255274
|
||||
2021-06-30,334023
|
||||
2021-07-03,239532
|
||||
2021-07-04,332379
|
||||
2021-07-06,304824
|
||||
2021-07-07,233457
|
||||
2021-07-08,270742
|
||||
2021-07-09,275372
|
||||
2021-07-10,290695
|
||||
2021-07-11,354016
|
||||
2021-07-14,308333
|
||||
2021-07-16,330349
|
||||
2021-07-17,279489
|
||||
2021-07-18,278827
|
||||
2021-07-19,246737
|
||||
2021-07-21,350309
|
||||
2021-07-22,253080
|
||||
2021-07-23,318424
|
||||
2021-07-24,283229
|
||||
2021-07-27,387702
|
||||
2021-07-28,359999
|
||||
2021-07-29,262529
|
||||
2021-07-31,329220
|
||||
2021-08-02,245560
|
||||
2021-08-03,371978
|
||||
2021-08-04,316774
|
||||
2021-08-05,269694
|
||||
2021-08-06,321235
|
||||
2021-08-07,337118
|
||||
2021-08-08,336951
|
||||
2021-08-09,332485
|
||||
2021-08-10,340650
|
||||
2021-08-13,292215
|
||||
2021-08-15,228006
|
||||
2021-08-16,261552
|
||||
2021-08-18,289464
|
||||
2021-08-19,331391
|
||||
2021-08-20,335894
|
||||
2021-08-22,345662
|
||||
2021-08-25,250506
|
||||
2021-08-26,324127
|
||||
2021-08-29,300704
|
||||
2021-08-30,216277
|
||||
2021-09-01,390319
|
||||
2021-09-02,302408
|
||||
2021-09-04,236882
|
||||
2021-09-05,328498
|
||||
2021-09-06,373802
|
||||
2021-09-07,257518
|
||||
2021-09-08,315544
|
||||
2021-09-09,331703
|
||||
2021-09-10,295623
|
||||
2021-09-11,262576
|
||||
2021-09-12,330202
|
||||
2021-09-16,334117
|
||||
2021-09-20,318918
|
||||
2021-09-21,333662
|
||||
2021-09-22,303395
|
||||
2021-09-23,343089
|
||||
2021-09-25,246715
|
||||
2021-09-26,365227
|
||||
2021-09-30,279069
|
||||
2021-10-01,274862
|
||||
2021-10-03,351246
|
||||
2021-10-04,224027
|
||||
2021-10-06,315712
|
||||
2021-10-08,207710
|
||||
2021-10-10,313050
|
||||
2021-10-11,320580
|
||||
2021-10-12,317107
|
||||
2021-10-13,255801
|
||||
2021-10-14,336348
|
||||
2021-10-15,326889
|
||||
2021-10-17,388537
|
||||
2021-10-18,358864
|
||||
2021-10-20,334452
|
||||
2021-10-21,315859
|
||||
2021-10-22,277687
|
||||
2021-10-23,275894
|
||||
2021-10-24,348859
|
||||
2021-10-25,345117
|
||||
2021-10-27,297398
|
||||
2021-10-28,279729
|
||||
2021-10-30,255008
|
||||
2021-11-01,284791
|
||||
2021-11-02,366217
|
||||
2021-11-03,273734
|
||||
2021-11-04,305492
|
||||
2021-11-05,317993
|
||||
2021-11-06,271900
|
||||
2021-11-07,305045
|
||||
2021-11-09,253836
|
||||
2021-11-10,350490
|
||||
2021-11-12,219134
|
||||
2021-11-13,294765
|
||||
2021-11-14,343896
|
||||
2021-11-15,289186
|
||||
2021-11-16,180454
|
||||
2021-11-17,311418
|
||||
2021-11-18,282468
|
||||
2021-11-19,287422
|
||||
2021-11-20,257198
|
||||
2021-11-21,263091
|
||||
2021-11-22,300996
|
||||
2021-11-23,264009
|
||||
2021-11-24,329625
|
||||
2021-11-25,324373
|
||||
2021-11-26,280376
|
||||
2021-11-27,288525
|
||||
2021-11-28,363799
|
||||
2021-11-29,282045
|
||||
2021-12-01,341980
|
||||
2021-12-02,312170
|
||||
2021-12-03,261025
|
||||
2021-12-04,328802
|
||||
2021-12-07,302062
|
||||
2021-12-09,262532
|
||||
2021-12-10,332557
|
||||
2021-12-11,299194
|
||||
2021-12-12,303596
|
||||
2021-12-13,370443
|
||||
2021-12-15,315328
|
||||
2021-12-16,388561
|
||||
2021-12-18,370054
|
||||
2021-12-19,382960
|
||||
2021-12-23,225437
|
||||
2021-12-24,292496
|
||||
2021-12-25,325016
|
||||
2021-12-26,362916
|
||||
2021-12-27,257472
|
||||
2021-12-28,311747
|
||||
2021-12-30,279110
|
||||
2021-12-31,196848
|
||||
2022-01-02,298355
|
||||
2022-01-04,368999
|
||||
2022-01-06,300327
|
||||
2022-01-08,265559
|
||||
2022-01-09,314257
|
||||
2022-01-12,252150
|
||||
2022-01-13,351088
|
||||
2022-01-14,274378
|
||||
2022-01-15,271547
|
||||
2022-01-18,262993
|
||||
2022-01-19,372874
|
||||
2022-01-20,318061
|
||||
2022-01-21,383376
|
||||
2022-01-22,311890
|
||||
2022-01-23,333323
|
||||
2022-01-25,332426
|
||||
2022-01-26,275171
|
||||
2022-01-27,303853
|
||||
2022-01-29,289020
|
||||
2022-01-30,327096
|
||||
2022-01-31,281682
|
||||
2022-02-02,275490
|
||||
2022-02-03,383535
|
||||
2022-02-04,296316
|
||||
2022-02-05,351592
|
||||
2022-02-06,325564
|
||||
2022-02-07,307185
|
||||
2022-02-08,314678
|
||||
2022-02-10,259845
|
||||
2022-02-11,338493
|
||||
2022-02-12,226951
|
||||
2022-02-13,320409
|
||||
2022-02-15,278782
|
||||
2022-02-16,260904
|
||||
2022-02-17,327639
|
||||
2022-02-18,281008
|
||||
2022-02-20,312974
|
||||
2022-02-21,283881
|
||||
2022-02-22,282495
|
||||
2022-02-23,333772
|
||||
2022-02-24,245480
|
||||
2022-02-25,287406
|
||||
2022-02-26,331523
|
||||
2022-02-28,319978
|
||||
2022-03-01,283928
|
||||
2022-03-04,282503
|
||||
2022-03-05,355399
|
||||
2022-03-06,236853
|
||||
2022-03-08,247027
|
||||
2022-03-11,310629
|
||||
2022-03-12,354012
|
||||
2022-03-13,307891
|
||||
2022-03-14,350998
|
||||
2022-03-15,234012
|
||||
2022-03-16,283284
|
||||
2022-03-17,332824
|
||||
2022-03-21,219997
|
||||
2022-03-22,359558
|
||||
2022-03-23,247878
|
||||
2022-03-25,269752
|
||||
2022-03-26,373325
|
||||
2022-03-31,366303
|
||||
2022-04-03,222577
|
||||
2022-04-05,336306
|
||||
2022-04-06,232151
|
||||
2022-04-07,329687
|
||||
2022-04-13,319182
|
||||
2022-04-14,287659
|
||||
2022-04-16,272320
|
||||
2022-04-17,321487
|
||||
2022-04-18,340860
|
||||
2022-04-19,236354
|
||||
2022-04-20,320432
|
||||
2022-04-21,400641
|
||||
2022-04-22,267561
|
||||
2022-04-24,299550
|
||||
2022-04-26,362361
|
||||
2022-04-29,292377
|
||||
2022-04-30,289468
|
||||
2022-05-01,248577
|
||||
2022-05-02,241467
|
||||
2022-05-04,266245
|
||||
2022-05-05,333287
|
||||
2022-05-06,303953
|
||||
2022-05-09,309336
|
||||
2022-05-11,381499
|
||||
2022-05-12,348890
|
||||
2022-05-13,406413
|
||||
2022-05-14,360551
|
||||
2022-05-16,380784
|
||||
2022-05-17,291891
|
||||
2022-05-21,290653
|
||||
2022-05-22,295487
|
||||
2022-05-23,253226
|
||||
2022-05-27,329659
|
||||
2022-05-28,414924
|
||||
2022-05-29,302741
|
||||
2022-05-30,264788
|
||||
2022-05-31,217593
|
||||
2022-06-02,261180
|
||||
2022-06-03,295243
|
||||
2022-06-07,282270
|
||||
2022-06-08,332795
|
||||
2022-06-14,400955
|
||||
2022-06-15,366259
|
||||
2022-06-16,319197
|
||||
2022-06-17,300354
|
||||
2022-06-20,267838
|
||||
2022-06-22,299957
|
||||
2022-06-23,299123
|
||||
2022-06-24,258038
|
||||
2022-06-25,267308
|
||||
2022-06-27,230123
|
||||
2022-06-28,285768
|
||||
2022-06-29,278569
|
||||
2022-06-30,304007
|
||||
2022-07-01,352665
|
||||
2022-07-02,277065
|
||||
2022-07-05,281774
|
||||
2022-07-06,345073
|
||||
2022-07-08,317068
|
||||
2022-07-09,374064
|
||||
2022-07-11,243048
|
||||
2022-07-12,381713
|
||||
2022-07-13,308419
|
||||
2022-07-15,266591
|
||||
2022-07-16,343427
|
||||
2022-07-17,267296
|
||||
2022-07-18,301904
|
||||
2022-07-19,268985
|
||||
2022-07-20,269354
|
||||
2022-07-21,242209
|
||||
2022-07-23,304538
|
||||
2022-07-24,321849
|
||||
2022-07-25,320558
|
||||
2022-07-27,283398
|
||||
2022-07-28,308368
|
||||
2022-07-29,321836
|
||||
2022-07-30,253049
|
||||
2022-07-31,402333
|
||||
2022-08-03,357724
|
||||
2022-08-04,226488
|
||||
2022-08-05,247356
|
||||
2022-08-06,234899
|
||||
2022-08-08,317464
|
||||
2022-08-10,262772
|
||||
2022-08-11,313256
|
||||
2022-08-13,275101
|
||||
2022-08-14,344720
|
||||
2022-08-15,313842
|
||||
2022-08-16,325843
|
||||
2022-08-17,324050
|
||||
2022-08-18,390448
|
||||
2022-08-19,354854
|
||||
2022-08-20,340872
|
||||
2022-08-22,275545
|
||||
2022-08-25,277279
|
||||
2022-08-27,349831
|
||||
2022-08-28,231753
|
||||
2022-08-29,266744
|
||||
2022-09-02,266383
|
||||
2022-09-04,269079
|
||||
2022-09-05,274862
|
||||
2022-09-07,308898
|
||||
2022-09-08,274465
|
||||
2022-09-09,258048
|
||||
2022-09-12,339535
|
||||
2022-09-14,352963
|
||||
2022-09-15,354002
|
||||
2022-09-16,258307
|
||||
2022-09-21,305506
|
||||
2022-09-23,294024
|
||||
2022-09-25,327077
|
||||
2022-09-26,288372
|
||||
2022-09-28,280282
|
||||
2022-10-01,280759
|
||||
2022-10-02,264145
|
||||
2022-10-05,342762
|
||||
2022-10-06,299775
|
||||
2022-10-09,279429
|
||||
2022-10-10,335244
|
||||
2022-10-11,306739
|
||||
2022-10-12,335628
|
||||
2022-10-13,275652
|
||||
2022-10-14,309627
|
||||
2022-10-20,214583
|
||||
2022-10-22,321149
|
||||
2022-10-23,290458
|
||||
2022-10-24,295040
|
||||
2022-10-25,252892
|
||||
2022-10-26,378766
|
||||
2022-10-28,296984
|
||||
2022-10-29,246649
|
||||
2022-10-31,247637
|
||||
2022-11-02,391106
|
||||
2022-11-03,234747
|
||||
2022-11-04,248504
|
||||
2022-11-05,285295
|
||||
2022-11-06,294848
|
||||
2022-11-07,372159
|
||||
2022-11-08,281897
|
||||
2022-11-09,287656
|
||||
2022-11-10,173868
|
||||
2022-11-11,341964
|
||||
2022-11-12,358992
|
||||
2022-11-13,335488
|
||||
2022-11-15,298316
|
||||
2022-11-16,316291
|
||||
2022-11-17,338106
|
||||
2022-11-18,280470
|
||||
2022-11-20,380544
|
||||
2022-11-21,272462
|
||||
2022-11-22,263061
|
||||
2022-11-23,341689
|
||||
2022-11-24,393098
|
||||
2022-11-25,281410
|
||||
2022-11-26,315452
|
||||
2022-11-29,393891
|
||||
2022-12-03,261234
|
||||
2022-12-04,206973
|
||||
2022-12-05,296886
|
||||
2022-12-06,325265
|
||||
2022-12-07,272677
|
||||
2022-12-09,276582
|
||||
2022-12-10,297452
|
||||
2022-12-11,267674
|
||||
2022-12-13,310775
|
||||
2022-12-14,325403
|
||||
2022-12-17,366387
|
||||
2022-12-19,271004
|
||||
2022-12-20,274431
|
||||
2022-12-21,321314
|
||||
2022-12-22,255268
|
||||
2022-12-23,348741
|
||||
2022-12-24,158015
|
||||
2022-12-25,296246
|
||||
2022-12-26,303504
|
||||
2022-12-28,262996
|
||||
2022-12-29,317554
|
||||
2022-12-30,274724
|
||||
2022-12-31,319566
|
||||
|
33
pds/cases/case_2/sourcing_events.csv
Normal file
33
pds/cases/case_2/sourcing_events.csv
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
date_ordered,date_received,amount
|
||||
2021-01-01,2021-01-20,16000000
|
||||
2021-01-24,2021-02-11,14000000
|
||||
2021-02-18,2021-03-10,9000000
|
||||
2021-03-16,2021-03-31,11000000
|
||||
2021-04-02,2021-04-19,16000000
|
||||
2021-04-20,2021-05-10,17000000
|
||||
2021-05-17,2021-06-10,15000000
|
||||
2021-06-15,2021-07-07,13000000
|
||||
2021-07-11,2021-08-01,10000000
|
||||
2021-08-05,2021-08-18,17000000
|
||||
2021-08-21,2021-09-08,12000000
|
||||
2021-09-13,2021-09-29,13000000
|
||||
2021-09-30,2021-10-11,11000000
|
||||
2021-10-15,2021-11-04,15000000
|
||||
2021-11-08,2021-11-28,14000000
|
||||
2021-12-03,2021-12-21,13000000
|
||||
2021-12-24,2022-01-10,10000000
|
||||
2022-01-16,2022-01-27,14000000
|
||||
2022-01-29,2022-02-18,17000000
|
||||
2022-02-22,2022-03-13,11000000
|
||||
2022-03-17,2022-04-02,12000000
|
||||
2022-04-07,2022-05-03,13000000
|
||||
2022-05-05,2022-05-30,14000000
|
||||
2022-06-05,2022-06-17,17000000
|
||||
2022-06-21,2022-07-13,16000000
|
||||
2022-07-20,2022-08-13,12000000
|
||||
2022-08-20,2022-09-09,15000000
|
||||
2022-09-11,2022-09-22,14000000
|
||||
2022-09-23,2022-10-17,13000000
|
||||
2022-10-24,2022-11-14,20000000
|
||||
2022-11-20,2022-12-14,16000000
|
||||
2022-12-17,2022-12-23,12000000
|
||||
|
BIN
pds/cases/case_3/case_3.zip
Normal file
BIN
pds/cases/case_3/case_3.zip
Normal file
Binary file not shown.
BIN
pds/cases/case_3/case_3_description.docx
Normal file
BIN
pds/cases/case_3/case_3_description.docx
Normal file
Binary file not shown.
175
pds/cases/case_3/case_3_description.md
Normal file
175
pds/cases/case_3/case_3_description.md
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
# Case 3: Improving last mile logistics with Machine Learning
|
||||
|
||||
After your last engagement, you have pretty much become the go-to
|
||||
service provider for advanced quantitative methods. Congratulations!
|
||||
|
||||
You have been called again to help a different manager within Beanie Limited:
|
||||
Estefania Pelaez. Estefania is the city manager for Barcelona. She is in charge
|
||||
of all commercial and logistic operations that happen in the city.
|
||||
|
||||
One of the operations that Beanie Limited runs in Barcelona is their own
|
||||
last-mile coffee delivery service. The company runs a small fleet of vans and
|
||||
trucks that delivers small orders of roasted coffee beans (typically,
|
||||
around 10-100kg of coffee per delivery) to restaurants, cafes, hotels and other
|
||||
businesses in the city.
|
||||
|
||||
The efficiency of the deliveries is important to keep margins profitable for
|
||||
Beanie Limited. A sloppy management can make the company lose money. Hence,
|
||||
Estefania is always working on ways to make the operations as smooth as
|
||||
possible.
|
||||
|
||||
Currently, Beanie Limited has rented space in two warehouses: one located in
|
||||
Zona Franca and another one in Baro de Viver. Complementing that, the company
|
||||
has a small fleet of combi vans, regular sized vans and one truck, which are
|
||||
used by Beanie Limited own drivers to deliver the coffee beans from the
|
||||
warehouses to the customer's facilities.
|
||||
|
||||
Orders placed by the customers are predictable and placed with time in advance,
|
||||
which allows Estefania and her team to plan the deliveries and minimize wasted
|
||||
effort by the fleet. Since they know which locations they will need to deliver
|
||||
to, they use a routing software that drafts the routes that each vehicle will
|
||||
cover each day.
|
||||
|
||||
Recently, Estefania recently realized something: deliveries are almost always
|
||||
taking place too early or too late. After researching with some data, Estefania
|
||||
found out that there was nothing wrong with the routing software time
|
||||
estimates: the driving time between locations predicted by the software is
|
||||
accurate. The real issue is related to what Estefania's team calls the "
|
||||
engine-off" time.
|
||||
|
||||
The engine-off time is the time a driver spends actually dropping off goods in
|
||||
a client location. It's called engine-off because the clock starts ticking when
|
||||
the driver takes the keys off the van and stops when the driver starts driving
|
||||
again.
|
||||
|
||||
Currently, Estefania and her team assume an engine-off time of 3 minutes for
|
||||
all deliveries when building the delivery routes and schedules. But it seems
|
||||
that this not realistic at all and is causing a lot of trouble with the
|
||||
schedules. Clients are not happy with delivery times not being respected, some
|
||||
driver routes end up too early (which means that the same driver could have
|
||||
covered more clients) and some others run for too long (which means they have
|
||||
to go back to the warehouse without delivering all the goods requested by the
|
||||
clients).
|
||||
|
||||
If Estefania could know beforehand what would be the engine-off time of
|
||||
different deliveries, she could improve the route planning to fix all of these
|
||||
issues. She has been told that Machine Learning could help with this and is
|
||||
expecting you to find out if and how it can be applied to this problem.
|
||||
|
||||
## Detailed Task Definition
|
||||
|
||||
- Below you will find tasks organized in four levels.
|
||||
- You need to write a report document where you answer the questions of the
|
||||
different levels. This report should be directed towards Estefania, should
|
||||
give her clear recommendations and should justify these recommendations. It's
|
||||
important for you to reflect your methodology to back your proposals.
|
||||
- Each level is worth 2 points out of a total of 10. The 2 missing points will
|
||||
grade the clarity and structure of your report.
|
||||
- You need to use a Python notebook to solve all levels. Please attach a
|
||||
notebook that shows your solution/proposal/analysis. Your notebook should be
|
||||
runnable "as-is". That means that anyone should be able to run it from
|
||||
beginning to end without any additional instructions or action required (
|
||||
except for uploading data from a CSV in the Google Colab environment. That
|
||||
requires someone to upload the file with a few clicks and it's fine).
|
||||
- Include your team number, names and student IDs in all your deliverables.
|
||||
|
||||
## Data
|
||||
|
||||
By joining the customer database together with past deliveries details,
|
||||
Estefania has built a dataset of execute deliveries. The table contains 9,000
|
||||
examples of past deliveries and their engine-off times. The exact field
|
||||
meanings are explained below:
|
||||
|
||||
- client_name: the name of the client.
|
||||
- truck_size: what type of truck was being used. Can be one of Combi, Van or
|
||||
Truck.
|
||||
- truck_origin_warehouse: from which Beanie Limited warehouse did the route
|
||||
start.
|
||||
- delivery_timestamp: at what date and time was the delivery done (defined as
|
||||
the moment the engine-off time starts).
|
||||
- total_weight: total weight of the goods delivery.
|
||||
- brand_1_coffee_proportion: what percentage of the delivery was of Beanie's
|
||||
brand #1.
|
||||
- brand_2_coffee_proportion: what percentage of the delivery was of Beanie's
|
||||
brand #2.
|
||||
- brand_3_coffee_proportion: what percentage of the delivery was of Beanie's
|
||||
brand #3.
|
||||
- driver_id: the ID of the driver that was driving the route.
|
||||
- is_fresh_client: whether the client was fresh at the date of the delivery.
|
||||
Fresh clients are clients that have been doing business with Beanie for less
|
||||
than 30 days.
|
||||
- postcode: the postcode of the client location.
|
||||
- business_category: whether the client is a hotel, a cafe or restaurant or a
|
||||
coffee retailer.
|
||||
- floor: the physical position of the client location.
|
||||
- partnership_level: indicates the partnership level with Beanie. Key Account
|
||||
are important clients for Beanie Limited. Diamond clients are the top
|
||||
priority clients for the company.
|
||||
- box_count: how many distinct boxes were delivered to the client. The coffee
|
||||
beans bags are grouped into boxes for delivery.
|
||||
- final_time: the engine-off time, measured in seconds.
|
||||
|
||||
## Notebook
|
||||
|
||||
Case 3 comes with no helping notebook: this time, you will have to code things
|
||||
from scratch yourselves. Remember that you are still suposed to write and
|
||||
deliver a notebook (see the "Detailed Task Definition" section).
|
||||
|
||||
A few comments on your notebook:
|
||||
|
||||
- I'm a going to constraint you to use [scikit-learn](https://scikit-learn.org/stable/) as a ML library. You can
|
||||
of course use other useful Python libraries such as pandas, numpy, etc. But
|
||||
for ML modeling, please go with scikit-learn.
|
||||
- Below you can find some useful materials which relate to what you need to do
|
||||
as part of the case:
|
||||
- [A simple, guided EDA on the Titanic Dataset](https://www.datacamp.com/tutorial/kaggle-machine-learning-eda)
|
||||
- [A guide on regression performance metrics](https://machinelearningmastery.com/regression-metrics-for-machine-learning/)
|
||||
and some [material from scikit-learn on the same topic](https://scikit-learn.org/stable/modules/classes.html#regression-metrics)
|
||||
- An [introduction to cross-validation](https://machinelearningmastery.com/k-fold-cross-validation/)
|
||||
- A thorough [review on why we need to use baselines](https://blog.ml.cmu.edu/2020/08/31/3-baselines/) in ML
|
||||
- A simple [introduction to linear regression with scikit-learn](https://stackabuse.com/linear-regression-in-python-with-scikit-learn/)
|
||||
|
||||
## Levels
|
||||
|
||||
### Level 1
|
||||
|
||||
- Assess for Estefania if ML is a good choice for her problem and explain why.
|
||||
- Perform Exploratory Data Analysis on the given data. Is it clean? Which
|
||||
variables could be useful to explain the engine-off time? Are there any other
|
||||
interesting things you can draw from the dataset?
|
||||
|
||||
### Level 2
|
||||
|
||||
- Present how are you going to measure performance for this problem and how you
|
||||
will use the available data for testing it.
|
||||
- Develop a baseline algorithm and evaluate its performance.
|
||||
|
||||
### Level 3
|
||||
|
||||
- Develop the best model you can make to predict engine-off time.
|
||||
- Explain your methodology and report on performance.
|
||||
- Compare your performance to the baseline algorithm. Reflect on what is the
|
||||
cause of whatever differences can be observed between both.
|
||||
|
||||
### Level 4
|
||||
|
||||
After presenting your model and results, Estefania has two different questions:
|
||||
- Estefania would like to learn from the ML algorithm. What are the most
|
||||
relevant features that define the engine-off time? Can you somehow quantify
|
||||
how important each is or which are most useful?
|
||||
- Estefania is interested in learning about next steps. What can be done to
|
||||
improve even more the model performance and achieve better results?
|
||||
|
||||
### SPECIAL
|
||||
|
||||
For this case, we are going to run a little competition. There will be a
|
||||
surprise gift on the last lecture for the team that wins.
|
||||
|
||||
The competition consists on getting the best performing model of the course. I
|
||||
have a hidden part of Estefania's dataset. Besides the data for the case, I have
|
||||
also added an additional thousand records for which you don't have the engine off
|
||||
time (so you can make predictions, but you can't compare them against the true
|
||||
result).
|
||||
|
||||
To enter the competition, you will have to send me a csv with a single column named "predictions". Each row should be a record of the extra dataset, delivered in the same order as the predictive features you received. I will measure the RMSE of all deliveries and the team with the lowest RMSE will be the winner.
|
||||
|
||||
BIN
pds/cases/case_3/case_3_description.pdf
Normal file
BIN
pds/cases/case_3/case_3_description.pdf
Normal file
Binary file not shown.
1001
pds/cases/case_3/competition_dropoffs_df.csv
Normal file
1001
pds/cases/case_3/competition_dropoffs_df.csv
Normal file
File diff suppressed because it is too large
Load diff
1001
pds/cases/case_3/competition_dropoffs_df_only_x.csv
Normal file
1001
pds/cases/case_3/competition_dropoffs_df_only_x.csv
Normal file
File diff suppressed because it is too large
Load diff
9001
pds/cases/case_3/dropoffs_df.csv
Normal file
9001
pds/cases/case_3/dropoffs_df.csv
Normal file
File diff suppressed because it is too large
Load diff
10001
pds/cases/case_3/full_dropoffs_df.csv
Normal file
10001
pds/cases/case_3/full_dropoffs_df.csv
Normal file
File diff suppressed because it is too large
Load diff
BIN
pds/cases/case_3/grading/grading.xlsx
Normal file
BIN
pds/cases/case_3/grading/grading.xlsx
Normal file
Binary file not shown.
BIN
pds/cases/case_3/grading/grading_team_1.xlsx
Normal file
BIN
pds/cases/case_3/grading/grading_team_1.xlsx
Normal file
Binary file not shown.
BIN
pds/cases/case_3/grading/grading_team_2.xlsx
Normal file
BIN
pds/cases/case_3/grading/grading_team_2.xlsx
Normal file
Binary file not shown.
BIN
pds/cases/case_3/grading/grading_team_3.xlsx
Normal file
BIN
pds/cases/case_3/grading/grading_team_3.xlsx
Normal file
Binary file not shown.
BIN
pds/cases/case_3/grading/grading_team_4.xlsx
Normal file
BIN
pds/cases/case_3/grading/grading_team_4.xlsx
Normal file
Binary file not shown.
BIN
pds/cases/case_3/grading/grading_team_5.xlsx
Normal file
BIN
pds/cases/case_3/grading/grading_team_5.xlsx
Normal file
Binary file not shown.
BIN
pds/exam/exam.odt
Normal file
BIN
pds/exam/exam.odt
Normal file
Binary file not shown.
BIN
pds/exam/exam.pdf
Normal file
BIN
pds/exam/exam.pdf
Normal file
Binary file not shown.
33
pds/pds panel.md
Normal file
33
pds/pds panel.md
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
|
||||
|
||||
|
||||
| Week | Ready | Main item | Classes | Student work | | |
|
||||
| ---- | ----- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --- |
|
||||
| 1 | Yes | Python Prep | - L1: Introduction and motivation of the course<br/> - L2: Simulation, Optimization and Machine Learning in companies | - Python prep | | |
|
||||
| 2 | Yes | Case 1 | - L3: Introduction to simulation: What is it, When do we use it, Types of simulation<br/> - L4: Simulation examples in Python. Introduction to case 1. | - Python prep<br/> - View [Primer: Simulating a pandemic](https://www.youtube.com/watch?v=7OLpKqTriio) <br/>- Read [Agent-based modeling: Methods and techniques for simulating human systems](https://www.pnas.org/content/99/suppl_3/7280) <br/> - Read case 1. | | |
|
||||
| 3 | | Case 1 | - L5: Simulation methodology. <br/> - L6: Simulation-based optimization I. Challenges and issues with simulation. Where to go from here<br/> - S1: Workshop for case 1 | - Work on case 1 <br/> - Review [HASH model market simulation](https://hash.ai/@hash/model-market-python) <br/>- Review [HASH warehouse simulation](https://hash.ai/@hash/warehouse-logistics) | | |
|
||||
| 4 | | Case 1/2 | - L7: Introduction to optimization<br/> - L8: Modeling optimization problems<br/> - S2: Workshop for case 1 | - Work on case 1 <br/> - Read Gurobi's [Modelling Basics](https://www.gurobi.com/resource/modeling-basics/) <br/> - Read Neos [taxonomy of optimization problems](https://neos-guide.org/optimization-tree) <br/> - View this video on the [Simplex algorithm](https://www.youtube.com/watch?v=RO5477EKlXE) | | |
|
||||
| 5 | | Case 2 | - L9: Taxonomy of optimization techniques <br/> - L10: Simulation-based optimization II. Introduction to case 2 | - Deliver case 1 <br/> - Read case 2 <br/> - Enjoy watching [simulation-based race car training](https://www.youtube.com/watch?v=-sg-GgoFCP0) <br/> - Read how the [4th most popular database software in the world uses GAs to access data faster.](https://www.postgresql.org/docs/8.0/geqo-intro2.html) | | |
|
||||
| 6 | | Case 2 | - L11: Challenges in real-world usage. Simulation vs Optimization <br/> - L12: Introduction to Machine Learning <br/> - S3: Workshop for case 2 | - Work on case 2 <br/> - Read this [review on simulation optimization techniques and softwares](https://arxiv.org/pdf/1706.08591.pdf) | | |
|
||||
| 7 | | Case 2/3 | - L13: Supervised Machine Learning (SML): NIPS<br/> - L14: Typical SML workflow. Introduction to case 3<br/> - S4: Workshop for case 2 | - Work on case 2 <br/> - Read case 3 | | |
|
||||
| 8 | | Case 3 | - L15: Algorithm deep dive: Decision trees<br/> - L16: Feature Engineering and Model Evaluation<br/> - S5: Workshop for case 3 | - Deliver case 2 <br/> - View this [intro to neural networks](https://www.youtube.com/watch?v=aircAruvnKk&t=10s) and this [intro to random forests](https://www.youtube.com/watch?v=J4Wdy0Wc_xQ) | | |
|
||||
| 9 | | Case 3 | - L17: Deployment of Models <br/> - L18: Stories from the trenches: applying all of this in the real world<br/> - S6: Workshop for case 3 | - Work on case 3 <br/> - View this video on [why businesses fail at ML](https://www.youtube.com/watch?v=dRJGyhS6gA0) | | |
|
||||
| 10 | | Case 3 | - L19: Where to go from here: further learning and carreer advice<br/> - L20: Final Q&A, exam preparation | - Work on case 3 | | |
|
||||
| 11 | | | - Exam | - Deliver case 3 | | |
|
||||
|
||||
|
||||
|
||||
| Week | Ready | Main item | Classes | Student work | | |
|
||||
| ---- | ----- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --- |
|
||||
| 1 | Yes | Python Prep | - L1: Introduction and motivation of the course<br/> - L2: Simulation, Optimization and Machine Learning in companies | - Python prep | | |
|
||||
| 2 | Yes | Case 1 | - L3: Introduction to optimization<br/> - L4: Case 1 Discussion | - Python prep<br/> - View [Primer: Simulating a pandemic](https://www.youtube.com/watch?v=7OLpKqTriio) <br/>- Read [Agent-based modeling: Methods and techniques for simulating human systems](https://www.pnas.org/content/99/suppl_3/7280) <br/> - Read case 1. | | |
|
||||
| 3 | | Case 1 | - L5: Introduction to simulation: What is it, When do we use it, Types of simulation <br/> - L6: Simulation Methodology<br/> | - Work on case 1 <br/> - Review [HASH model market simulation](https://hash.ai/@hash/model-market-python) <br/>- Review [HASH warehouse simulation](https://hash.ai/@hash/warehouse-logistics) | | |
|
||||
| 4 | | Case 1/2 | - L7: Case 1 Workshop <br/> - L8: Simulation-based Optimization I | - Work on case 1 <br/> - Read Gurobi's [Modelling Basics](https://www.gurobi.com/resource/modeling-basics/) <br/> - Read Neos [taxonomy of optimization problems](https://neos-guide.org/optimization-tree) <br/> - View this video on the [Simplex algorithm](https://www.youtube.com/watch?v=RO5477EKlXE) | | |
|
||||
| 5 | | Case 2 | - L9: Case 2 Discussion <br/> - L10: Simulation-based optimization II: GA | - Deliver case 1 <br/> - Read case 2 <br/> - Enjoy watching [simulation-based race car training](https://www.youtube.com/watch?v=-sg-GgoFCP0) <br/> - Read how the [4th most popular database software in the world uses GAs to access data faster.](https://www.postgresql.org/docs/8.0/geqo-intro2.html) | | |
|
||||
| 6 | | Case 2 | - L11: Challenges in real-world usage. Stochastic vs Traditional Optimization <br/> - L12: Case 2 Workshop | - Work on case 2 <br/> - Read this [review on simulation optimization techniques and softwares](https://arxiv.org/pdf/1706.08591.pdf) | | |
|
||||
| | | | | | | |
|
||||
| 7 | | Case 2/3 | - L13: Supervised Machine Learning (SML): NIPS<br/> - L14: Typical SML workflow. Introduction to case 3<br/> - S4: Workshop for case 2 | - Work on case 2 <br/> - Read case 3 | | |
|
||||
| 8 | | Case 3 | - L15: Algorithm deep dive: Decision trees<br/> - L16: Feature Engineering and Model Evaluation<br/> - S5: Workshop for case 3 | - Deliver case 2 <br/> - View this [intro to neural networks](https://www.youtube.com/watch?v=aircAruvnKk&t=10s) and this [intro to random forests](https://www.youtube.com/watch?v=J4Wdy0Wc_xQ) | | |
|
||||
| 9 | | Case 3 | - L17: Deployment of Models <br/> - L18: Stories from the trenches: applying all of this in the real world<br/> - S6: Workshop for case 3 | - Work on case 3 <br/> - View this video on [why businesses fail at ML](https://www.youtube.com/watch?v=dRJGyhS6gA0) | | |
|
||||
| 10 | | Case 3 | - L19: Where to go from here: further learning and carreer advice<br/> - L20: Final Q&A, exam preparation | - Work on case 3 | | |
|
||||
| 11 | | | - Exam | - Deliver case 3 | | |
|
||||
Loading…
Add table
Add a link
Reference in a new issue