3 ms·
Not quite that easy. What if two trains are both traveling towards separate green signals into the same block such that the second train gets a red signal, but
by 0xffff2 1y ago
Not quite that easy. What if two trains are both traveling towards separate green signals into the same block such that the second train gets a red signal, but not in time to stop? I think it's possible to overcome this, but it become vastly more complicated than just "turn the signals red for the current block if it's occupied".
- wongarsu 1y agoYou are right, reality is more complicated. In reality some blocks need more than two states and need to know the state of adjacent blocks. For example in a one-way track with two every points you would want to deny entry from one entry point if the track leading to the other entry point is occupied, to solve your case. And you probably want to call that state "reserved" instead of "occupied" to prevent a cascade if you have multiple such blocks right after each other. But the point that you can do this local-first is still true. You will want to engage a couple bits of information with the neighboring block, but you don't need to know any global state, and if one block breaks down that only affects its direct neighbors