mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 23:17:56 +01:00
89de7380ee
exchange_through_hoses() worked out on every call which vehicles the brake and the main reservoir hoses join into trains (hose_trains(): the list sorted by address, a search through the couplers), and laid them out train by train: ~2.7% of the main thread on Tomaszewo, for trains which change only with a coupling, a vehicle going to sleep or waking up, or one added or taken away. vehicle_table::update_brake_pipes(), which passes all the vehicles of the scenery in every step, now keeps them in a physics::hose_trains_cache (physics/components/hosetrains.h) together with what they were worked out from: of each vehicle of the list, whether it stepped the pipe and the neighbour the hose of each end joins it to. On every step that is gathered again (one pass over the list) and compared: the trains are worked out again unless it's all the same, so they're always the ones hose_trains() gives. The groups stepped in parallel (update_steps_parallel()) and physics::Vehicle::UpdatePipeCouplers() work them out on each call as before. hose_substeps() goes by the pressures, which change in every step, and is left as it is. The unit tests' consist steps its brake pipes the way update_brake_pipes() does now, with the trains kept, so the golden traces (recorded on staging) check the kept trains, the uncouplings of the tests included. 600 s in --test, seed 12345, one run each: Tomaszewo (raj40821) sim 134.9 s against 137.4 s the step before (-1.8%); L107 (linia_107_objazdy) sim 18.1 s against 18.8 s. The physics logs (14 and 9) and the event logs are byte-identical to staging's, unit tests 1207/1207 with exact golden traces.