I'm working on a (over-engineered) project which involves having a storage depot before a station in which trains wait until a space is free at the station. I've done all the infrastructure and I need a solution with the signaling & logic behind the system. Here is the infrastructure:
On the top left you can see the depot which consists of 9 holding cells (A1, A2, A3, B1, B2, B3, C1, C2 & C3). Each cell stores trains for a particular platform of the station, of which there are also 9 (P1 to P9). So for P1 the trains wait at depot cell A1, for P2 the trains wait at cell P2 and so on... Each station platfor is designed to hold 2 trains loading + 1 train waiting:
Whenever there are 2 trains loading and another waiting behind the station sign S1 turns red and won't allow another train in. Now let's look at the depot:
What I want is to synchronize the signs depot A1 with sign S1 from the station platform P1 (Once I figure out one I'll do the rest myself). This would mean that only 3 trains will be able to go to the station immediately and then they will stop at the depot, but there is a problem: If the train leaves the depot to fill up the space, there is not enough time for it to turn the signal S1 red and more trains will leave, coughing up the system. There would be a few ways to solve it here:
- Have the signals A1 on a timer (Once they've turned red, they have to stay red for a certain amount of time): This allows 1 train to leave, which then turns all signals red due to the fact that only 1 path is available, which is taken by the leaving train. Then after a while the signals A1 can turn green again but at that point, hopefully, the train is already at the station and turning signal S1 red. this should mean A1 also stays red!
- Using an edge detector somehow: We can use an edge detector (a device that will turn the A1 signals green briefly everytime signal S1 turns red). this way only a single train is dispatched at the time again due to the fact that 1 train reserves the path and blocks all other trains from going. Both of these methods only work if there is at all times just a single path for trains to take therefor each holding cell has a bypass which allows previous holding cells to pass them while'st limiting the amount of possible paths for those cells to 1.
I've looked at using programmable signs which looks promising as well as "routefinding restrictions" (Both in the JGR Patch Pack v0.32.3). Preferably I'd like to not use extra tracks (I know there is a way to combine the block behind sign S1 and after the signs A1 and turn them in a single block, obviously you would need to replace the path based signals). Therefor I'm looking for maybe a signal based solution or for a timetable solution? Either that or a timetable solution (IDK just throwing the idea there if anyone knows).
Is there a clean way to do this without changing the rail layout too much? Here is a zoomed in screenshot of the setup: https://imgur.com/a/vINnp6B
In it's current form the holding cells A3, B3 & C3 don't work as there are multiple paths for trains to take and therefor multiple trains will depart at the same time, I'll be able to fix this though! Also there are also other systems included in the screenshot, including a very elaborate waypoint system which I hope doesn't confuse people. In essence, there are priority tracks where higher priorities have lower chances of being stopped by train merging, at some points these higher priorities are in the most inner track while at other points they are highest at the most outer track. I'm sorry if this is confusing but it works for me! Also I'm sorry for those who like right hand driving for trains...
Thanks in advance for the help! I'd love to keep people updated on how this project turns out!