Author Topic: long block signals - reservations go too far  (Read 1336 times)

0 Members and 1 Guest are viewing this topic.

Offline Vladki

long block signals - reservations go too far
« on: May 25, 2017, 06:17:21 PM »
Hello I have done some more testing with long block signals, and found a weird behavior.
Get the save game: http://server.exp.simutrans.com/debug-saves/long-block.sve
and pakset: http://server.exp.simutrans.com/pak128.CS-Ex.zip

You will see the sation smolenice with one train just about to depart towards bukova. Start signals are longblock signals, and the reservation will go just up to the home signal at bukova, which is ok. Also when the train departs from bukova it will make reservation only towards home signal at dubrava loop. But when the train passes through the tunnel, and makes reservation ahead of Dubrava, you'll see that there are directional reservations "everywhere". In fact the reservations go to Jablonica, turn back, and continue to Bukova. If you, check the schedule of line (1), you'll see that Bukova is marked as reversal stop, instead of Jablonica. But that itself is another bug. The problem is, that the directional reservation should have stopped at home signal (choose signal) at Jablonica, regardelss of its reversal status.

I do not understand, why it worked fine on departure form Smolenice and Bukova, and went wrong on approach to Dubrava. Either it is because the train is not scheduled to stop there (only a waypoint), or that there is an unsignalled stop Cerova on the way.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 16086
  • Total likes: 438
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: long block signals - reservations go too far
« Reply #1 on: June 04, 2017, 04:22:23 PM »
Thank you for the report, and apologies that I have not had time to look at this before. I wonder whether this is related to the reversing issues that have recently emerged and at least some of which have now been fixed; would you be able to re-test this by seeing whether this issue still occurs after modifying the schedule of any affected line (it does not matter if it is modified back again, so long as the schedule window is closed between the first modification and the reversion).
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Vladki

Re: long block signals - reservations go too far
« Reply #2 on: June 11, 2017, 12:49:54 PM »
I have updated the long block save (link in the first post). The reversal points in schedule are fixed now, but the long-block behavior is not as was intended.

Now the train attemtps to make directional reservation throughout the whole line up to the reversal point. Load the game and pause it immediately. Check the reservations - you'll see that there are several stretches of blue reservations, all belonging to train (13) "CD_810_balkan" which is departing from Jablonica. There are even several on-way signs on the double track part of the line, but the reservation extends (with some breaks) all the way to Krizovany (the other reversal stop).

1. My original intent with long signals was, that the directional reservation should end on the next Long block signal ahead. I want the player to have full control on the directional reservations.
2. It would be nice if choose signals could work with directional reservations too, and not allow making one, if all platforms ahead of choose signal are reserved (or occupied) by trains in the opposite direction. This could help against deadlocks, especially on terminal stations. But if it would simplify the algorithm (not having to do the choose logic for directional reservation), I would recommend ending the directional reservation on the choose signal.
3. I remember I have asked for "repairing" the directional reservation in the rear of train if there was a directional reservation in the rear previously. This does not seem to work - the directional reservation is "repaired" only until the next train in rear does not pass the long block signal. So it seems to be "repaired" by long block signal truing repeatedly to make the directional reservation as far as possible. In retrospect I think It would be better if the directional reservation is not "repaired" tile-by-tile, but created newly after passing not only long block, but also regular signals (but not choose signals) even if they are not bidirectional. Long block signals would then mark only the end of directional reservation.
4. I though One way signs were also intended to stop directional reservations, but it clearly does not work (at least not always). This should be fixed, as they are the only way to stop directional reservations if there are no longblock signals in the pakset.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 16086
  • Total likes: 438
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: long block signals - reservations go too far
« Reply #3 on: June 11, 2017, 01:49:05 PM »
There are a number of different issues here. Firstly, long-block signals as I have implemented them (except in the time interval working method) are intended to have the directional reservational properties of bidirectional signals without actually being bidirectional, which was I think the substance of what was originally requested. Something different to this would take quite a lot of additional work, which is difficult to justify given the other things needing to be done.

The idea is that a directional reservation ends when it reaches a piece of track that is clearly unidirectional, and where a directional reservation is no longer necessary, hence it ending at one way signs. I notice that you report that this does not always work. Can you upload a saved game in which this can be reproduced reliably?

As to choose signals, what is being requested, I think, amounts to some considerable and very complex additional logic because this requires a change in the way in which directional reservations are currently intended to work (they work by being allowed to be made successfully over an existing block reservation provided that the block reservation is in the same direction as the directional reservation). I do not think that this additional feature is likely to be practical to implement at this time.

As to "repairing", I am afraid that I do not recall the conversation about that and so do not really understand what you mean here. Can you elaborate?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Vladki

Re: long block signals - reservations go too far
« Reply #4 on: June 11, 2017, 08:10:15 PM »
There are a number of different issues here. Firstly, long-block signals as I have implemented them (except in the time interval working method) are intended to have the directional reservational properties of bidirectional signals without actually being bidirectional, which was I think the substance of what was originally requested. Something different to this would take quite a lot of additional work, which is difficult to justify given the other things needing to be done.
I do not want to add you extra work, but at this moment long block signals are not useful at all, they cause a lot of weird deadlocks, and I'm trying to gradually trace and report them. However it would be helpful to first sort out how they should behave. So that I can distinguish what is intentional and what not. My intent was to stop directional reservation on long block signals, in addition to current behavior - end on one-way sign and reversal point.

Quote
The idea is that a directional reservation ends when it reaches a piece of track that is clearly unidirectional, and where a directional reservation is no longer necessary, hence it ending at one way signs. I notice that you report that this does not always work. Can you upload a saved game in which this can be reproduced reliably?
Even the save game above - just load it, pause and check the whole dual track line. You will see directional reservations here and there. They all belong to the same train (13). There are one-way signs at all stations on dual track, usually next to the choose signals (so they may not be clearly visible). The reservation often ends at those signs, but then reappears ahead of the station again. EDIT added a new save http://server.exp.simutrans.com/debug-saves/long-block2.sve. Passing loops at Dubrava and Bukova have now one-way signs, and yet the reservation goes through them, causing deadlock. - one train is blocked at bukova home signal, the other cannot leave jablonica, even if you remove the reservation with the tool, it will be recreated again.

Quote
As to choose signals, what is being requested, I think, amounts to some considerable and very complex additional logic because this requires a change in the way in which directional reservations are currently intended to work (they work by being allowed to be made successfully over an existing block reservation provided that the block reservation is in the same direction as the directional reservation). I do not think that this additional feature is likely to be practical to implement at this time.
Maybe it would not be needed. Could you describe how directional reservation works on a choose signal now? What happens if the scheduled platform is occupied by train in the same direction, and what if it is occupied by train in opposite direction? What if all platforms are occupied in the same or opposite direction?

Quote
As to "repairing", I am afraid that I do not recall the conversation about that and so do not really understand what you mean here. Can you elaborate?
The idea was, that if the track in the rear of a train is directionally reserved by a train following it, then the tile that is about to be cleared, should be added to the directional reservation of the train in rear. But if it is not implemented, do not bother. We may find out that it is not necessary. However you can see such behavior when you load the above referenced savegame, and watch the train (13). Soon after loading the game, It calls at Cerova. When it departs, next train from Jablonica will reserve its way to cerova, plus a few tiles of directional reservation, up to the rear of train (13). This directional reservation is extended a few times until the train in rear passes the longblock signal. My original intent was that this should happen forever. But as I said do not bother with this now.
« Last Edit: June 11, 2017, 08:23:32 PM by Vladki »

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 16086
  • Total likes: 438
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: long block signals - reservations go too far
« Reply #5 on: June 11, 2017, 08:23:30 PM »
I do not want to add you extra work, but at this moment long block signals are not useful at all, they cause a lot of weird deadlocks, and I'm trying to gradually trace and report them. However it would be helpful to first sort out how they should behave. So that I can distinguish what is intentional and what not. My intent was to stop directional reservation on long block signals, in addition to current behavior - end on one-way sign and reversal point.

May I ask why this is necessary for long-block signals to be useful at all?


Quote
Even the save game above - just load it, pause and check the whole dual track line. You will see directional reservations here and there. They all belong to the same train (13). There are one-way signs at all stations on dual track, usually next to the choose signals (so they may not be clearly visible). The reservation often ends at those signs, but then reappears ahead of the station again.

To help me to reproduce more quickly, can you be more specific about where and when, after loading the game, the first incorrect reservation of this sort appears?

Quote
Maybe it would not be needed. Could you describe how directional reservation works on a choose signal now? What happens if the scheduled platform is occupied by train in the same direction, and what if it is occupied by train in opposite direction? What if all platforms are occupied in the same or opposite direction?

I cannot remember whether there was any additional logic for choose signals that are also long block signals, but I suspect that there was not, so choose signals when creating directional reservations will work in the same way as any other such signal (in fact, I do not think that I even tested this combination, as I was not aware of any use case for it based on the original description of the purpose of having signals that make directional reservations that are not bidirectional signals; this type is still not included in Pak128.Britain-Ex).

The basic logic for directional reservations is that, when making a directional reservation, the convoy will continue making it until the next place where it can be sure of getting unidirectional track (i.e. a one way sign). It will not clear the signal until it can get a complete directional reservation to the necessary point. For any given tile, a directional reservation will succeed even where there is a block reservation of an existing train or another directional reservation of that  train already on that tile, provided that the direction of the reservation be the same.

Quote
The idea was, that if the track in the rear of a train is directionally reserved by a train following it, then the tile that is about to be cleared, should be added to the directional reservation of the train in rear. But if it is not implemented, do not bother. We may find out that it is not necessary. However you can see such behavior when you load the above referenced savegame, and watch the train (13). Soon after loading the game, It calls at Cerova. When it departs, next train from Jablonica will reserve its way to cerova, plus a few tiles of directional reservation, up to the rear of train (13). This directional reservation is extended a few times until the train in rear passes the longblock signal. My original intent was that this should happen forever. But as I said do not bother with this now.

This would be very difficult, as it would require trains checking tiles to reserve ahead (or checking behind) in many cases where no checks at all are made at present.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Vladki

Re: long block signals - reservations go too far
« Reply #6 on: June 11, 2017, 08:43:21 PM »
I have modified my previous post while you were replying. There is one more save with directional reservations reaching ahead of one-way signs. In both saves it is in place already when you load it.

The whole idea of longblock signals is to allow track layouts like this: Single  track line. Stations with multiple tracks (3 and more), which can all be used in both directions - i.e. no one-way signs. Between the stations, there are more stops without any passing loops or sidings. Just a platform on the running line. To avoid having trains running in drive by sight after departing from such a stop, a plain signal has to be put on the end of platform. Simple signals can be used also to protect road crossings. Overall this slightly improves throughput in comparison to token block operation. Bidirectional signals are not useful here, or at least it looks weird to have bidirectional signals on both ends of platform. Crossings should be ahead of signal, but with bidirectional signal it would be in rear, or two bidirectional signals would have to be put on both sides of crossing. Directional reservation is deserved from one station to another, but in the absence of one-way signs, it would be made up to the end of line, which is not wanted. Therefore another condition to stop the directional reservation is needed. Long block signals are expected to be the start (departure) signals.

I never intended to combine choose and long signal in one. What I'm asking about is what happens when a directional reservation, made either by bidirectional signal or long block signal, reaches up to a choose signal, and the scheduled (straight) path is already reserved by some other train?

About repairing the directional reservation in rear - just forget about it, OK ?

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 16086
  • Total likes: 438
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: long block signals - reservations go too far
« Reply #7 on: June 20, 2017, 11:32:26 PM »
I think that I have managed to fix the issue with long block signals making directional reservations beyond one way signs: would you be able to re-test? Thank you for the report.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Vladki

Re: long block signals - reservations go too far
« Reply #8 on: June 23, 2017, 06:13:59 PM »
Unfortunately it is not fixed. I have uploaded a new save game. http://server.exp.simutrans.com/debug-saves/long-block3.sve
Look at station Jablonica with longblock start signals. There is a train that has recently reversed, and reserved way to cerova-lieskove stop, and then directiona reservation to Dubrava loop. The reservation does not end on the tile with one-way sign, but it just has a gap of 3 tiles and continues further on. The last tile of the gap is waypoint in that trains schedule. The blue reservation between dubrava and bukova belongs to a train in opposite direction, which is just departing from smolenice. Again, you can see a gap in the blue reservation at bukova loop. This time the waypoint is in the middle of platform. Most striking is the fact that the train in jablonica is waiting for clearance, even though the whole path to Dubrava is clear. If you let the game run, the train from smolenice will arrive to home signal at dubrava and stop there, because the tile ahead of home signal is reserved by the train from Jablonica.

What I would expect is, that the track between dubrava and bukova would not be reserved at all, until one of the trains approaches one of those loops (home signals are 3-aspect), and makes reservation further ahead. Then the trains should pass each other in one of those loops.

There are more longblock signals at station Boleraz (again as start signals), If the track ahead is clear you may catch more examples of directional reservations going through one-way signs.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 16086
  • Total likes: 438
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: long block signals - reservations go too far
« Reply #9 on: July 09, 2017, 12:31:46 AM »
Thank you for this. I have just pushed what I think is a fix for this. Are you able to re-test? I should be most grateful.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Vladki

Re: long block signals - reservations go too far
« Reply #10 on: July 09, 2017, 07:12:06 PM »
This seems to be partially fixed. Reservations between jablonica and smolenice seem to behave correctly.
However I have noticed a few occasions of directional reservations going too far from boleraz. I have not yet catched the exact circumstaces, when they occur, but it seems to be related to multi-aspect long signals, and non-stoip trains. I'll report back when I manage to repeat that.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 16086
  • Total likes: 438
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: long block signals - reservations go too far
« Reply #11 on: July 09, 2017, 08:54:16 PM »
Thank you for letting me know - do let me know if you can find a reliable reproduction of a different issue.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.