Repository navigation
nav: the CoPH ledger's items in the episode record (C5 part 2c) - #1502
Merged
Merged
Conversation
While a sim_world's nav_stats is armed, coph_driver::apply() feeds that tick's share of every attached car's account to sim_world::feed_coph. The next step() folds it into the collector as nav_samplers::coph. A coph_sample holds a CoPH step's work, heat, kinetic change, residual, shaping jump, unallocated work and risk cost, and every tick's |e|^2 dt and |u|^2 dt. - veh_nav_stats gains the CoPH ledger for a car CoPH drove (coph_tracked): coph_steps, work, heat, kinetic change, residual and its largest step |residual|, shaping jumps, unallocated work, risk cost, and allocation residual sqrt(sum e2 / sum u2). - episode_nav_stats gains coph_vehicles, the fleet's work, heat and unallocated work, and the largest step |residual|. - plant_ledger.h has a coph source and its own tables, plant_ledger_coph_vehicle() and plant_ledger_coph_episode(). The JSON and cvcGL's publish_nav_stats write them only for what CoPH drove. Every other run, and every reader that takes a column or key per item of the plant tables (nav_arms' .cvcrun columns, the panels, pycvc's lists), is unchanged. - The driver books each term once and hands the same value to both its account and the feed, so each sum in the record is the account's, bit for bit. The shaping jumps are differences of the learner's running total, so they agree to round-off. Tests: - NavStats.CophLedger: the reduction, the JSON, applicability, and a run fed no terms being the fed one's record less its CoPH keys. - CophDriver.TheEpisodeRecordCarriesTheCarsAccount: car 0 over 200 ticks; every sum equals its account. - CophDriver.ARecordWithoutCophHasNoneOfItsKeys: armed nav_stats and a driver that drives nothing give the record with no driver, byte for byte.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
C5 part 2c of
docs/roadmap/NAV-COPH-ROADMAP.md(§4.5, D11): the episode record carries the CoPH ledger of each car acoph_driverdrives.What changes
nav_statsis armed,coph_driver::apply()passes that tick's share of each attached car's account to the newsim_world::feed_coph. The nextstep()folds it into the collector asnav_samplers::coph. Acoph_sampleholds:|e|²dtand|u|²dt.coph_tracked) getscoph_steps,coph_work,coph_heat,coph_kinetic_change,coph_residual,coph_residual_max,coph_shaping_jumps,coph_unallocated_work,coph_risk_costandcoph_allocation_residual.coph_vehicles, the fleet's sums and the largest step residual.plant_ledger_coph_vehicle()andplant_ledger_coph_episode(), with a newsource::coph.publish_nav_statswrite them only for what CoPH drove..cvcruncolumns, the panels, and pycvc's item lists.Without
nav_statsarmed,feed_cophdoes nothing, and nothing else touches the run.Checked on Windows (Release, MSVC 19.44)
nav_stats_test(18 tests):NavStats.CophLedgercovers the reduction, the JSON, which items apply, and an unfed run whose record equals the fed one's minus its CoPH keys.nav_coph_driver_test(7 tests):TheEpisodeRecordCarriesTheCarsAccount: car 0 over 200 ticks. Every sum equals its account (99 CoPH steps, allocation residual 0.149). Car 1, driven by the sim, has no CoPH keys.ARecordWithoutCophHasNoneOfItsKeys: withnav_statsarmed, a driver that drives nothing leaves the JSON byte for byte as it is without a driver.nav_arms_test(20) andnav_coph_fleet_test(8, G12) are unchanged.Not checked locally: cvcGL's
nav_stats_publish.cpp, because this build hasCVC_BUILD_CVCGL=OFF. CI compiles and tests it.Left out
The cross-episode scorecard (
aggregate_nav), nav_arms'.cvcruncolumns and pycvc's item lists don't take the CoPH items yet. Each can read them from the new tables when a reader needs them.