18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-24 13:09:16 +01:00
Files
maszyna/tests/unit/test_uphill_start.cpp
pawelw 7c12b83ba4 fix(ai): an uphill start keeps the power on until the train brake is off (#396)
* fix(ai): an uphill start keeps the power on until the train brake is off

The uphill start of #265 ended as soon as the power held the train (or the head of the
train moved back 0.5 km/h). From then on the brake still on in the wagons made Ready false,
the power went off, the train rolled back, was braked again and the start began anew; only
the cylinders falling below 0.8 bar let the train get away.

- Once the power holds the train, the start goes on while the train brake is released:
  Ready holds, the power stays on, bounded to 1.5 x the grade force. It ends when the
  consist is released (the same test as Ready, without the hold) or after 60 s.
- A start is given up for rolling back on the mass-weighted speed of the consist, not on
  the speed of the locomotive, which runs back into the slack of the train held by its brake.
- A train slipping back uphill is not released by the rule for a train to go on.

* fix(ai): an uphill start begins only with the whole train at a stand

* fix(ai): an uphill start applies the train brake further while it doesn't hold the train without the locomotive brake

* fix(ai): the speed and the tractive force of an uphill start in the direction of travel also from cab 2

* fix(ai): an uphill start tops up the train brake a full application time a step, at most to full service, and keeps the power between 1.1 and 1.5 times the grade force while the brake releases

* fix(ai): an uphill start no longer takes a notch back in the release phase: the notch below doesn't hold the train

* refactor(ai): the train brake top-up of an uphill start in uphill_start::brake_top_up(), with unit tests
2026-11-22 12:27:18 +01:00

4.2 KiB