Force path recalculation

Smart setups of railway stations, intelligent routing, solutions to complex train-routing problems.
Please provide - only if it makes sense of course - a blueprint of your creation.
Post Reply
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2916
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Force path recalculation

Post by Optera »

Have you ever had trains stuck on blue chain signals in front of stackers?

Place this surprisingly simple setup in front of the first chain signal and it will force all trains to recalculate their path (repath).
2017-08-06-18-51-18-0843572.jpg
2017-08-06-18-51-18-0843572.jpg (68.71 KiB) Viewed 5819 times
I'm almost certain this was posted before, but I can't find the original post anymore.

Edit: Updated to better logic preventing stuck trains.
Last edited by Optera on Sun Aug 06, 2017 4:52 pm, edited 1 time in total.

aaargha
Filter Inserter
Filter Inserter
Posts: 330
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: Force path recalculation

Post by aaargha »

I've had similar ideas, show the train a red signal for one tick, but my setup used a combinator to do the single pulsing. The advantage yours has, in addition to being simpler, is that it should also work with modded trains that travel at ludicrous speeds (reserves multiple signals each tick).

A potential problem your setup has is that a train can possibly get stuck between the signals if there is a red signal further ahead, but I'll have to test that to know for sure. A simple way to make this a non issue is to make the read signal also output yellow on red.

Interestingly enough neither of our solutions should have any effect on the blue chain signal situation. If a train tries to reserve a blue chain signal that does not allow progress along the its intended path the train will try to find another, it's the same as seeing a red signal. Trains waiting in front of open stackers is usually a sign of the pathfinder not liking the design, paths through occupied slots are still seen as cheaper than the free ones.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2916
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Force path recalculation

Post by Optera »

A potential problem your setup has is that a train can possibly get stuck between the signals if there is a red signal further ahead, but I'll have to test that to know for sure. A simple way to make this a non issue is to make the read signal also output yellow on red.
Good catch.
I built this contraption at least 1 loco length in front of the chain signal by chance, so i never noticed the possibility of locking a train down.

Setting the 2nd signal to closed when green != 0 will have the same repath effect without getting trains getting stuck.
Interestingly enough neither of our solutions should have any effect on the blue chain signal situation. If a train tries to reserve a blue chain signal that does not allow progress along the its intended path the train will try to find another, it's the same as seeing a red signal. Trains waiting in front of open stackers is usually a sign of the pathfinder not liking the design, paths through occupied slots are still seen as cheaper than the free ones.
This particular design was made for my LTN depots, which can hold every train going there.

At stackers with not enough space for all trains it'll behave like it wasn't there once it's full.
Such stackers need different signaling shown here. The drawback of this solution is you can't have pass through or PAX tracks.

quinor
Filter Inserter
Filter Inserter
Posts: 404
Joined: Thu Mar 07, 2013 3:07 pm
Contact:

Re: Force path recalculation

Post by quinor »

To the top! I have struggled with that and gave up after not coming up with such simple idea. I see several places to apply that one, will be mandatory for my next base.

Post Reply

Return to “Railway Setups”