18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-18 23:26:03 +01:00
Files
maszyna/vehicle/Driver.cpp
pwarszawski 292092a7aa AI braking: take care of the Sonar remarks on the new braking code
No change in what the AI does; only the structure of the code that came in
with the braking changes:

- S107: shaped_braking_demand() takes the consist brake table as a struct
  instead of four separate parameters; its lambdas capture explicitly.
- S3358: brake_response_horizon() picks the BrakeDelay entry without a
  nested conditional operator.
- S5276: the speed passed to braking_distance_multiplier() is converted to
  float explicitly, as it was implicitly before.
- S134: the stop case of the proximity range is an else-if of its own, and
  its body a method of its own, adjust_desired_speed_for_final_approach(),
  with early returns instead of nested ifs. The cargo train threshold
  push is a conditional subtraction instead of a nested if.
- S3776: pick_optimal_speed() hands the uncoupling stages and the uphill
  stand to set_velocity_for_uncoupling() and
  hold_train_coming_to_stand_uphill().
2026-11-07 21:40:02 +01:00

392 KiB