However, after playing with signals in various positions I noticed a few anomalies which I thought might be exploitable for distinguishing between a train that happens to be in front of a station "incidentally" and a train that is there as part of a scheduled delivery.
I set up a test rig to look into it these more rigorously; this post will document my findings.
First, I made a nice, slow 1-14-1 train that slowly ambles between four stations like so:
- go to the East Wye terminus and wait zero seconds
- proceed to Demonstration Station and wait for five seconds
- go to West Wye, wait zero seconds
I then laid down some signals like so:
I have provisioned each of the stations with three signals: two as close as I could place them just before the station, and one as close as I could place it just after the station. Finally, I made a big oscilloscope to allow myself to visualize the pattern of data coming from the signals with tick-level granularity (this was inspired by Madzuri's recent twitch stream). Here's what the whole thing looks like:
Here is the scope showing the train approaching and docking at Demonstration Station:
First, it is notable that the frontmost signal always stays green (this also makes perfect sense and could be achieved by manual control of the train). But I'm not sure this is the best thing to rely on to detect a scheduled train stop, because, if another train were leaving the station right in front of us, it could still cause that signal to be red.
Second, it is quite striking that just as the scheduled train docks at its scheduled stop, the middle signal transitions immediately from yellow to green. I think I have struck paydirt here. It may be possible to make this happen without a scheduled train-stop, but it would appear to be a pretty unlikely occurrence. Perhaps you'd need blow the train up, take a sudden manual turn, change the schedule, or remove a piece of track -- I have not tried super-carefully to rule out the possibility of false positives. By contrast, when the train blows past skippy, the middle signal behaves just like the other two, going from green to yellow to red.
Third, when the train leaves, the middle signal turns yellow for one tick, and then red. I've tested with a 2-0-2 train and the exact same thing happens.
So there you have it. In my next post, I'll show how these findings can be translated into a fairly straightforward combinator contraption which exploits these quirks to quite reliably detect whether or not a train is making a scheduled stop at a vanilla train station.