mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-19 18:05:01 +01:00
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().
This commit is contained in:
@@ -349,6 +349,9 @@ private:
|
||||
void pick_optimal_speed( double const Range );
|
||||
void adjust_desired_speed_for_obstacles();
|
||||
void adjust_desired_speed_for_limits();
|
||||
void set_velocity_for_uncoupling();
|
||||
void hold_train_coming_to_stand_uphill();
|
||||
void adjust_desired_speed_for_final_approach( double const Vel );
|
||||
void adjust_desired_speed_for_target_speed( double const Range );
|
||||
void adjust_desired_speed_for_current_speed();
|
||||
void adjust_desired_speed_for_braking_test();
|
||||
|
||||
Reference in New Issue
Block a user