Description
Add explicit energy margin fields to planning comparison rows.
Energy margin should compare final battery state against target SOC.
Add fields such as:
target_soc_pct
soc_margin_pct
battery_capacity_wh
target_battery_energy_wh
final_battery_energy_wh
energy_margin_wh
Use the existing RaceConfig.target_soc and car battery capacity.
Acceptance Criteria
- Planning comparison rows include SOC margin.
- Planning comparison rows include energy margin in Wh.
- Energy margin uses
RaceConfig.target_soc.
- Energy margin uses
CarConfig.battery_capacity.
- Positive margin means the run finished above target SOC.
- Negative margin means the run finished below target SOC.
- Tests or manual verification cover positive, zero, and negative margin cases.
Notes
This is an Improvement because planning rows already include final SOC and target SOC, but do not explicitly calculate margin.
References
sim/planning/comparison.py
sim/config.py
sim/simulator.py
Description
Add explicit energy margin fields to planning comparison rows.
Energy margin should compare final battery state against target SOC.
Add fields such as:
target_soc_pctsoc_margin_pctbattery_capacity_whtarget_battery_energy_whfinal_battery_energy_whenergy_margin_whUse the existing
RaceConfig.target_socand car battery capacity.Acceptance Criteria
RaceConfig.target_soc.CarConfig.battery_capacity.Notes
This is an Improvement because planning rows already include final SOC and target SOC, but do not explicitly calculate margin.
References
sim/planning/comparison.pysim/config.pysim/simulator.py