Write the weekly marketing and logistics policy for a country grain elevator's crop year: shuttle train bookings, trucks to the river terminal, forward sales and the futures hedge under a railroad tariff, position limits and a margin line; it is scored by simulation over hidden crop years.
harbor run -t reactive-labs/grain-elevator-marketingharbor download reactive-labs/grain-elevator-marketingYou are Ines Kovarik, grain merchandiser at Sandhollow Farmers Cooperative. The co-op buys corn and soybeans from its members at the Tessler Junction elevator and the Orrin satellite, hedges them in July futures, and sells them to Carroway Grain at the Brannock Landing river terminal by truck and to Haldane Pacific Export by PWRY shuttle train. Today is Monday 26 July 2027. Dale Hutchens, the General Manager, wrote to you this morning:
Board meets on the 29th. I want to show them the weekly rule for 2027-28 as a GrainPlan policy, not another slide about what we did last year. Marit runs it against the model on many years like the one Prairie describes, under this year's railroad terms and with the river out for the winter. It gets judged on the RM-3 margin, and a year with a position breach or a train we fail to load counts as a failed year. Policy file in Marit's format, please.
In /app/inputs:
RE_2027-28_marketing_plan_as_a_GrainPlan_policy.eml: the thread with Dale, Operations and Grain AccountingPWRY_Tariff_4100-C_Grain_Shuttle_Program_eff_2025-08-01.pdf and
PWRY_Tariff_4100-D_Grain_Shuttle_Program_eff_2027-08-01.pdf: the railroad's shuttle programSFC_Board_Policy_RM-3_Grain_Position_and_Hedging_rev4.docx: position limits and how the margin is measuredSFC_MP-7_Marketing_Procedure_rev5.docx and SFC_Grain_Quality_and_Storage_Manual_GQ-2_sections_5-8.docx:
the weekly procedure, trucks, current practice, space and carrying chargesCarroway_Grain_Brannock_Landing_Purchase_Terms_2026.pdf,
Haldane_Pacific_Export_Grain_Purchase_Terms_2026.pdf: the buyers' termsCarroway_Notice_to_Shippers_2027-07-12_winter_receiving.pdf and
MRND_Notice_to_Navigation_2027-11_Lock_14.pdf: the winter river closureTallgrass_Agricultural_Bank_Hedge_Margin_Line_2027-28.pdf: the margin linePrairie_AgriAnalytics_Crop_Outlook_2027-07-19.pdf: the crop outlookSFC_position_report_2027-07-26_and_opening_2027-08-02.csv: the opening positionIn /app/sim: GrainPlan, the model Grain Accounting uses to test marketing rules (README.md explains it and the
policy interface), with starter_policy.py (current practice, MP-7 Appendix A), the 2026-27 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 crop year 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 for each of the 52 weeks with the observation described in the README (the week's
July futures, spot and forward bids, the bins at both sites, the hedge, open contracts, trains placed and
booked, whether the river terminal is open, truck capacity, the position limits, the latest crop estimate and
last week's deliveries). It returns the week's orders: the futures target, transfers, trucks to the river,
the commodity for each placed train, deliveries against contracts, forward sales, and shuttle bookings and
cancellations.Your policy will be run, week by week, over many simulated 2027-28 crop years drawn as the Prairie outlook describes, under the tariff, the river closure, the opening position and the other terms as they apply to 2027-28. Each year is scored on its RM-3 merchandising margin as the share of the possible gain you capture: zero at what current practice (MP-7 Appendix A) makes in the same year, full marks at what a plan makes that knew that year's futures, bids and deliveries in advance. No rule that has to book trains and sell before prices, basis and deliveries are known can reach full marks; every dollar counts. A year in which a Monday position report is outside the RM-3 limits or a placed train is not loaded, or in which the policy fails, returns an invalid decision or breaks the time limits, scores zero.