This could actually work rather well.
You could add the priority to existing combination signals or path signals.
Code: Select all
Combination Priority Signal:
Train reaches a prioitized entry signal.
Train adopts the priority (Low, Medium or High)
A number of checks follow:
Is there a train inside the block?
-- If true, wait until this is false
Is there a green exit (or combo) signal in the block I want to enter?
-- If false, wait until this is true
Is there a higher priority train waiting at an entry signal?
-- If true, wait until this is false
Then use the default behaviour for multiple trains waiting at signals, for waiting identical priority trains
The same basic checks apply to path based signals. Before a path is reserved the signal checks if higher-priority trains are trying to resevre a path, then it goes back to default behaviour.
Now to take the above pic and add some trains to it.
There is already a train in the block, and a high-priority waiting on the north mainline.
A low-priority train reaches the entry signal. It sees there is already a train within the block, so it waits (default block signal behaviour)
The train clears the block through the south exit.
Both the high-priority signal and the low-priority signal see a valid exit.
The high priority signal has a train waiting, so it goes through the checks first. The low-priority signal waits.
The high priority sees nothing else waiting, so it enters the black and heads for the green exit.
Finally, the low priority train goesthrouh the block when it sees a green exit.
There is one way this can backfire. If high-priority trains keep arriving before the low-priority train can get through, it may never get to leave, causing a massive backlog on that line.
A solution to this is adding an extra check: How many higher-priority trains have gone through the block?
A parameter to the options menu could control this. Say you set it to 5. This means that when 5 higher priority trains have gone before the waiting train (counted from when the low priority train starts waiting) the low priority train gets to 'queuejump', increasing it's priority by one (low>med>high). Once it reaches equal priority than the other waiting trains the signals go to the default behaviour, which is 'first-come-first-served'.
So, changing our example, the low-priority train can't go because high-priority trains keep arriving. It waits until5 trains have passed, the increases it's priority to medium. It still can't go because the priority for the other lines is 'high', so it waits for another 5 trains to go past before increasing it's priority again.
Now, because all three lines are (temporarily) the same priority, the signals revert to default behaviour. The sideline train has been waiting for the longest time, so it now gets to enter the block.
Note that the priority only changes for one train, any subsequent low-priority trains arriving at the same signal will still have to wait.