Planner burn rates rarely get two fuel samples: a fuel-only change writes no history row #19
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Found while building the fuel watch (issue #5).
What happens.
planning/fuel.pyestimates burn only from at least two observed fuel samples, andPlanningStore._fuel_samples(operations/planning_store.py) takes them fromobservation_history.ObservationStore.applywrites a history row only whensemantic(old, False) != semantic(new, False), andsemantic()coversfields, position (not with motion off), route and relations, notfuel_quantities. So an aircraft flying steadily (no change of condition, status, fuel state or route) gets no new sample while its fuel falls.Effect. Burn rate, endurance, station time, bingo time and reserve margins in planning come out
unknownfor most airborne aircraft until something else about them changes. The planner can't tell when a package needs a tanker on the way, and its bingo abort rule has no planned time.Reproduce. Apply one own aircraft twice with only its fuel quantity lower (10,000 then 9,000, ten game minutes apart).
observation_historyhas one row for it, andassess_fuelreportsendurance_unknown.tests/stage4/test_fuel_watch.pybuilds this world.Workaround in the fuel watch (#5).
agents/fuel_watch.pykeeps the readings it sees in memory. The planner has no such store.Possible fixes.
fuel_sample). The agent router ignores it becausematerial_changeshas nothing to route, but history views and rules would see it.fuel_samplestable (one row per unit, fuel type and game time, bounded per unit). This needs a schema migration, and the planner and the watch would both read it.Option 2 keeps history meaningful; option 1 needs no migration.