Write the nightly production policy for a wholesale bakery over a Christmas period in which a new labour agreement, a supermarket contract amendment and a new key account take effect; it is scored by simulation over hidden periods.
harbor run -t reactive-labs/bakery-production-planharbor download reactive-labs/bakery-production-planYou are Nadia Brennock, Production Planning Manager at Ashby Fold Bakery in Wexcombe, a wholesale bakery that bakes overnight on two lines for supermarket stores and cafes. Every afternoon at 14:00 the planner fixes tonight's bake plan for the next morning's deliveries and the laminated dough for the day after, before most of the orders are in. Today is Monday 29 November 2027. Gareth Imrie, the Operations Director, wrote to you this morning:
Please write the production policy for the four weeks of deliveries from Monday 6 December to Sunday 2 January, that is the 14:00 reviews from Sunday 5 December to Saturday 1 January, as a policy Priya's BakePlan can run, so we can test it before it goes to the planners and Systems can put it behind the review screen. I will judge it on plan cost for the period as SOP section 9 defines it, and it must never put a crew outside the new agreement or break the SOP limits.
In /app/inputs:
RE_December_production_policy_BakePlan.eml: the thread with Gareth, Finance & Systems, Finance, HR and CommercialAFB-PRD-004_Production_Planning_and_Despatch_SOP_RevH.docx: the production planning and despatch SOPFBWU_AFB_Collective_Agreement_2027-2029_Night_Production.docx: the night production labour agreementBrightwell_Supply_Agreement_BWS-SA-2024-031.docx and Brightwell_BWS-SA-2024-031_Amendment_No2.pdf,
Hollins_Cooperative_Terms_of_Supply_HCS-2025-07.docx, Garrick_Dene_Supply_Agreement_GDM-SA-2027-112.docx:
the supply agreementsAFB_Commercial_Memo_COM-2027-41_Christmas_trading_and_GD_launch.docx: the Christmas trading plan, promotions
and the new accountAFB_customer_master_2027-11-26.xlsx, AFB_promotions_register_2025-2027.csvAFB_BakeOffice_order_lines_...csv (every order line: the
quantity in the 14:00 book, the final order and what was delivered), AFB_BakeOffice_production_log_...csv,
AFB_BakeOffice_line_hours_...csv, Wexcombe_MetDesk_forecast_log_...csv and
Brightwell_SupplierLink_EPOS_weekly_...csvIn /app/sim: BakePlan, the model the bakery uses to test planning rules (README.md explains it and the policy
interface), with starter_policy.py (current practice) and the November 2027 baseline config and seeds 1-20.
Run it from /app with python -m sim.run --policy <file> --seeds 1-20.
/app/output/policy.py, defining a class Policy exactly as in /app/sim/README.md:
Policy() is constructed once per period with no arguments; it may load data files that you put in
/app/output next to it (find them relative to __file__).decide(obs) is called once per review with the observation described in the README: the review and delivery
dates, the customer list, the 14:00 order book for the delivery day, every customer's final orders for the
previous delivery day and what was baked, delivered, sold in the shop and wasted, four weeks of order totals by
account, the 14:00 weather forecasts for the delivery day and the day after, the laminated dough already
committed for tonight, and the week's overtime and fill so far. It returns
{"bake": {"L1": {sku: batches}, "L2": {sku: batches}}, "dough": {sku: batches}} with non-negative integers:
bake is tonight's plan for the non-laminated SKUs by line, dough the laminated dough for the day after the
delivery day.Your policy will be run, review by review, over many simulated periods like the one Gareth describes, 6 December 2027 to 2 January 2028, under the agreements and the SOP as they apply to those dates. Each period is scored on its SOP section 9 plan cost as the share of the possible saving you capture: zero at what the planner's rule (SOP Appendix C) costs on the same period, full marks at what a plan costs that knew that period's every final order in advance. No rule that has to bake ahead of the orders can reach full marks; every pound saved counts. A period in which any night breaks the labour agreement or the SOP limits, or in which the policy fails, returns an invalid plan or breaks the time limits, scores zero.