I've read several threads about controlling model trains and signaling, but nothing on Track Warrants. I'll start by saying that I don't want to have a computer hanging on my layout.
On the real thing, a central dispatcher gives a train crew a track warrant, which is an order to move from place to place. In addition to issuing the track warrant, the central dispatcher aligns the turnouts and sets the signal...and keep other traffic out of the way.
On this model train example, there are 3 pairs of red/blue tracks, where trains can pass or overtake, connected together by 2 single track mainlines. The layout contains 6 red/green signals (S1-S6), 6 un-powered blocking tracks, 8 turnouts (T1-T8), 12 electrically isolated blocks with occupancy detectors (B1-B12). The only requirement is a train must completely fit on a blue or red track.
I will use DCC to control the locomotives. If the trains have engineers with their hands on the throttle, I expect them to stop short of a red signal...and proceed through a green signal. If the trains are running un-attended, I will set them to run at different speeds and let them go. They will all run through a red signal and stop on the un-powered blocking track. A DCC controller talks to the locomotive quite often...so the locomotive will start up after track power is connected to the blocking track.
I assume that the Arduino can read each block detector. align each turnout, set the signals red or green and connect or disconnect track power from the black, blocking tracks. I'm sure some sort of proto shield will be required. The program will loop through all red and blue tracks, looking for a train to move. The table of movement looks something like this. The shorthand description of the first line is
The train on B1 can move to B6, when B3, B5 and B6 or not occupied (open) and the signals S2 and S3 are blocking traffic.
B1 > B6 when B3, B4, B5 and B6 are open and S2 and S3 are red
B2 > B6 when B3, B4, B5 and B6 are open and S1 and S3 are red
B6 > B11 when B8, B9 and B11 are open and S5 and S6 are red
B6 > B12 when B8, B9 and B12 are open and S5 and S6 are red
B11 > B7 when B7, B8, B9 and B10 are open and S5 and S4 are red
B12 > B7 when B7, B8, B9 and B10 are open and S6 and S4 are red
B7 > B1 when B1, B4 and B5 are open and S1 and S2 are red
B7 > B2 when B2, B4 and B5 are open and S1 and S2 are red
When it's time for our train on B1 to move, the turnouts T1, T3 and T4 are aligned, the signal S1 is set green, and track power is connected to the black blocking track. The first time the program looks at B1 and it's not occupied, track power is removed from the black, blocking track and the signal S1 is set red.
Other signals will be controlled by a GreenSteam GSP-14 Signal Controller By the way, this document begins with a nice dissertation on railroad signals.
Bhuck