Closed ed-rhilbert closed 1 year ago
Thanks for reporting the issue! The issue you're experiencing is due to incorrect detectors being linked to your signals:
At this point, you assume detectors[i]
yields detector D{i}
:
signals = [
T[i].add_signal(
detectors[i].position-20,
Direction.START_TO_STOP,
linked_detector=detectors[i],
label=f"S{i}"
)
for i in [0, 1, 3]
]
However, when created, detectors are added to the array out of order:
detectors = [
T[i].add_detector(label=f"D{i}", position=450)
for i in [0, 1, 3]
]
detectors += [
T[i].add_detector(label=f"D{i}", position=50)
for i in [2, 4, 5]
]
This issue can be fixed by appending detectors in order:
detectors = [
T[i].add_detector(label=f"D{i}", position=(450 if i in (0, 1, 3) else 50))
for i in range(0, 6)
]
A consequence of this mixup is that the detector associated with S2
is D3
, and the detector associated with S3
is D2
. This is invalid, as linked detectors should always be in downstream of signals. The route generator does not detect this edge case, and happily proceed to generate routes which stop at the associated detectors:
This invalid setup should definitely have been detected. I've opened an issue on the matter: #4613
We noticed a few additional issues with the route generator, which we'll fix as soon as we can:
@ed-rhilbert I just made a few changes to the railjson generator, some of which would have helped with your issue :
Please get in touch if you need any help. (I'll be on holidays next week)
If you managed to sort things out, you can close the issue
Hi @multun,
Back from holidays, I will test this new version. Sounds promising... I will let you know if everything is ok.
Anyway, thanks for considering my issues and your detailed answers 🙂
@multun , I confirm everythins is ok. Thanks again !
What happened?
When run with the CLI API of OSRD Core (java -jar .../osrd-all.jar ...), the infra above , generated with the attached python script, gives the warnings
and the error
cvg_dvg_bug.py.txt infra.json.txt simulation.json.txt
What did you expect to happen?
The same infra without a link between track sections runs ok !
cvg_dvg.py.txt infra.json.txt results.json.txt simulation.json.txt
How can we reproduce it (as minimally and precisely as possible)?
Run standalone simulations with the given infra.json and simulation.json
What operating system, browser and environment are you using?
OSRD version (top right corner
Account
button >Informations
)92ae674180f49cf9c29ceb6f07adc5aba591f320