mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-09 11:22:25 +01:00
AI braking: keep braking for a lower speed inside the proximity range
Inside the proximity range only a stop had a final approach of its own; for a lower speed ahead that branch set nothing, so AccDesired stayed at the preferred acceleration. With the range at 50 m, which this PR uses so that trains stop 8-15 m short of a signal, the AI stopped braking within the last 50 m before a speed restriction and even took power: EMUs reached a 20 km/h restriction at 25 km/h. On master the range is 15-40 m, which kept this mostly out of sight. A lower speed ahead now keeps the braking curve right up to where it begins. Stops are unchanged. Measured in real time on current master (with #199), with a 20 km/h restriction one coach long, two runs of 32 consists each: over 22 km/h in the restriction on the flat 9 on master, 15 before this change, 1 after (a 36WEa at 22.1 km/h); on the 20 per mille descent 15, 0 and 0. Stops 8-15 m short of the signal stay as they were (flat 57 and 55 of 64, descent 44 and 42), no overruns.
This commit is contained in:
@@ -7518,7 +7518,10 @@ TController::adjust_desired_speed_for_target_speed( double const Range ) {
|
||||
}
|
||||
else if (ActualProximityDist > fMinProximityDist) {
|
||||
// jedzie szybciej, niż trzeba na końcu ActualProximityDist, ale jeszcze jest daleko
|
||||
if (ActualProximityDist < fMaxProximityDist) {
|
||||
// only a stop has a final approach of its own inside the proximity range; a lower speed ahead
|
||||
// keeps the braking curve below right up to where it begins, or the train would stop braking
|
||||
// (and even take power) that far out
|
||||
if( ( VelNext == 0.0 ) && ( ActualProximityDist < fMaxProximityDist ) ) {
|
||||
// jak minął już maksymalny dystans po prostu hamuj (niski stopień)
|
||||
// ma stanąć, a jest w drodze hamowania albo ma jechać
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user