18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-27 21:45:16 +01:00
Files
maszyna/vehicle
jerrrrycho 2d16657c2e fix(ai): keep the locomotive released while it pushes the buffers in to uncouple (#482)
* test(scenarios): the L053 poranek cases now fail on the station's SM42

#409 fixed what both l053_poranek_tme222158_debica cases were marked
xfail for: the EP07 on Tm4 stops at the checkpoint, and the ET21 no
longer stands off the wire at Debica Towarowa. Run on staging f15ea405,
neither passes yet: TME222158 gets to Debica and reports there, but the
station's SM42-1096, ordered to uncouple at step 10 of deb_sm42_stat,
pushes its cut past debica_k_sem_info at danger and never gets the
coupler off, so the station never gives TME222158 step 1 and both runs
end as a standstill (4347 s and 4576 s of simulation time). The xfail
marks stay, with that reason.

* fix(ai): keep the locomotive released while it pushes the buffers in to uncouple

Stage 3 of uncoupling (TController::UpdateDisconnect) ends only when the locomotive has pushed the buffers
together: a screw coupler is let go with the buffers under 0.01 m apart (or over 0.2 m). Nothing else ends
the stage. The consist brakes applied in stage 2 hold the locomotive as well, and only its brake releaser
lets it go. The AI worked the releaser in that stage only while it wanted to speed up (AccDesired above
-0.05), together with the start-off rules of control_releaser.

When the cut stands across a signal at stop for the direction the locomotive pushes in, the driver counts
the signal as passed at its first move after the direction change, VelSignalLast becomes 0 and AccDesired
stays at -0.05 or -0.85. The releaser then went off, the brake cylinder filled again from the brake pipe,
the pressure switch cut the power, and the locomotive stood for good with the buffers 0.018 m apart. The
station's SM42-1096 at Debica on L053 poranek did that at step 10 of deb_sm42_stat and logged "actuating
and compressing buffers..." for the rest of the run (a temporary log line showed the brake cylinder going
from 1.25 to 3.69 bar with the releaser off, and the gap staying at 0.0184 m).

In stage 3 the releaser now stays on while the locomotive's brake cylinder holds more than 0.1 bar,
whatever AccDesired is. The push asks for 2 km/h at most and the cut stays braked, so this changes nothing
else. Everything else, including the rest of the uncoupling (the direction changes before and after it)
and coupling, keeps the old rule. The overcharge guard (pipe above 5.2 bar) still turns the releaser off.

The decision moves into vehicle/brakereleaser.{h,cpp} so it is unit tested; control_releaser does the same
cues in the same order as before.

On L053 poranek the SM42 now uncouples at step 10 in 0.2 s (gap 0.021 -> 0.0096 m) and the mission goes on.

* test(scenarios): a shunter uncouples with its wagons standing across a signal at stop

sm42_td_uncouple_past_signal (fragment td_uncouple_past_signal.scn) rebuilds the uncoupling of the SM42 at
Debica on L053 poranek on td.scn. An SM42 pulls three loaded wagons back along tor1k, stops in front of a
closed track with the far end of the last wagon 2 m past the exit signal stacja1_j at stop, and gets
Shunt 0 0 at once. The pull leaves the screw coupler 0.019 m apart at the buffers. Before the fix of the
releaser the locomotive stayed braked and the case ran into its timeout with no "uncoupled" in the log;
now it uncouples within a second.

* test(scenarios): the L053 poranek cases pass again

With the station's SM42-1096 uncoupling at step 10 of deb_sm42_stat again (the releaser fix before this
commit), both l053_poranek_tme222158_debica cases pass: TME222158 gets its exit signal at Debica after
4086.2 s of simulation, and with the ET21 after 4131.6 s. The xfail marks go, so that the runner doesn't
fail on XPASS, and the README rows say so.
2026-11-25 06:16:59 +01:00
..