Planner and fuel watch: keep own units' fuel readings for burn rates #40
Loading…
Reference in a new issue
No description provided.
Delete branch "vinny/fuel-samples"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #19.
observation_historygains a row only on a material change. An aircraft flying steadily therefore kept one fuel sample while its fuel fell, so the planner's burn rate, endurance, station time and bingo time stayed unknown.This PR takes option 2 from the issue:
migration_v19.py) addsobservation_fuel. Each row is an own unit's known fuel quantities at a game time.observation/store.pykeeps a reading when the quantities changed and at least 120 game seconds have passed since the unit's last one. It keeps the latest 8 readings per unit.PlanningStore._fuel_samples) and the fuel watch read these readings. The watch also adds the aircraft's current reading, and no longer keeps readings in memory.Tests:
tests/stage4/test_fuel_watch.pyreproduces the issue: readings of 10,000 and then 9,000 ten game minutes apart, with one history row. The planner now estimates 6,000 an hour. The test also checks the 120-second spacing and the 8-reading bound.Docs:
MIGRATION.md,PLANNING_ENGINE.md,TACTICAL_EXECUTION.md.🤖 Generated with Claude Code