mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-12 01:48:14 +01:00
AI braking: move the uphill power-off check into its own function
The condition added for holding the speed uphill near a stop pushed the cognitive complexity of control_tractive_force() to 26, over the 25 SonarCloud allows. It now lives in is_too_fast_uphill(); the behaviour is unchanged.
This commit is contained in:
@@ -358,6 +358,7 @@ private:
|
||||
void control_motor_connectors();
|
||||
void control_tractive_force();
|
||||
void increase_tractive_force();
|
||||
bool is_too_fast_uphill() const;
|
||||
void control_braking_force();
|
||||
// how far short of a stop the AI aims: in train running the middle of the 8-15 m window before a signal,
|
||||
// otherwise (a W4 stop point, shunting, coupling) half the minimum proximity distance, as before
|
||||
|
||||
Reference in New Issue
Block a user