switchtender: keep driving or take the train
It picks one of the two out loud each weekday morning as you come up on the split. Choose a morning below or build your own. The rule deciding it here is the same code the real service runs.
Open roads, a normal train. Nothing in the way.
switchtender says
Keep driving
Keep driving. Driving is 25 minutes, the train is 38 minutes. You would arrive at 8:40 AM. Driving saves 13 minutes, more than the 6 needed, the road ahead is clear. Confidence is high. Keep driving.
Adjust the morning
Why
The margin
- Driving has to save
- 5 × (1 + 3 × 0.05) = 5.8 minutes
- Driving saves
- 38 by train − 25 by car = 13 minutes
Driving saves 13, more than the 5.8 it needs. Keep driving.
Confidence
1, with nothing taken off
1 is high (0.75 or more)
These penalties only change confidence. The choice comes from the margin alone.
What it does
On a weekday morning switchtender compares two ways into town: stay in the car, or park and ride the train. It checks the traffic, any crashes, planned closures, events, track work and rail alerts. Then it says one sentence: which way to go, why, and how sure it is.
Only the part ahead counts
The road you have already driven is the same whichever way you go, so switchtender leaves it out. It measures only the two legs after the split: the rest of the drive, and the ride in from the station.
Warnings move confidence only
A crash report, a game tonight or a missing data feed can lower how sure it is. None of them can flip the answer. That comes only from the two travel times and how jammed the road is.
Unknown is not clear
When the traffic reading doesn't come back, switchtender won't treat the road as empty. It falls back to the minimum margin, takes confidence down a notch, and says the road ahead is unknown.
- How it decides: the rule on a chart
- Engineering notes: how it is built
- The code on GitHub
