Files
mcm-mfp/README.md
2026-01-17 23:06:43 +08:00

36 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 20260116 美赛模拟食物分发MFP
本仓库包含对 2019 年 MFP 站点数据的频次分配(任务一)与全年排班优化(任务二)脚本。
核心数据文件:`prob/MFP Regular Sites 2019.xlsx`
## Task 1: 频次分配Visit Frequency Allocation
目标:在总车次约束下,为每个站点分配年度访问次数 `f_i`,并评估有效性/公平性含最低10%平均、基尼系数等)。
- 运行:`python3 kmin_effectiveness.py`
- 输出(写入 `data/`
- `data/kmin_effectiveness.png`k_min 与指标曲线图
- `data/kmin_effectiveness_data.csv`:每个 `k_min` 的汇总指标 + 各站点 `visits_01..visits_N`
- `data/kmin_effectiveness_sites.csv``visits_XX` 与站点名称/顺序映射
说明:`kmin_effectiveness.py` 当前使用 Monte Carlo引入 `StDev(Demand per Visit)`)对有效性做多次模拟平均。
![kmin effectiveness](data/kmin_effectiveness.png)
## Scheduling (Step 2)
Optimize a 365-day schedule with at most 2 visits per day and minimum gap constraints:
- `python3 scheduling_optimization.py --days 365 --daily-capacity 2 --gap-min 14`
- Outputs are written to `data/` (e.g., `data/schedule_optimized_kmin6.8_gap14.csv`), using `data/kmin_effectiveness_data.csv` as the frequency source.
### Visualization (Plan A)
- `python3 visualize_schedule.py`
- Outputs: `data/schedule_barcode_*.png` and `data/schedule_gap_deviation_*.png`
- Site label rule: remove first 4 chars, then take 12 chars.
![schedule barcode](data/schedule_barcode_kmin6.8_gap14.png)
![schedule gap deviation](data/schedule_gap_deviation_kmin6.8_gap14.png)