4-way intersections: Throughput and deadlocks [image heavy]

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.
hansjoachim
Fast Inserter
Posts: 103
Joined: Wed Apr 26, 2017 7:03 pm

Re: 4-way intersections: Throughput and deadlocks [image heavy]

I took a look at your intersection.
4way 4 lanes with any train size
zero buffers
Set 1= 33 trains per min
Since it is a roundabout it can deadlock if trains change direction in the middle of the intersection.
One annoying problem is that two trains cant take right when coming from the same direction because you allow two routes for the inner lane.
The same problem occurs for straight as the outer lane has two routes for going straight. The shortest route would block trains in the inner lane for going straight and left.
At this throughput, two lanes would be better and save a lot of rails
Attachments
Immortal_sniper1s intersection
regular.png (4.69 MiB) Viewed 740 times
Updated version of aaarghas intersection testbench. viewtopic.php?f=194&t=46855&p=383830#p383830
My Highscore intersections: https://pastebin.com/dGsJT71Z
My 3 to 1 train merger https://pastebin.com/AcLHXcwd

immortal_sniper1
Fast Inserter
Posts: 176
Joined: Sun Jun 03, 2018 8:54 am

Re: 4-way intersections: Throughput and deadlocks [image heavy]

hansjoachim wrote:
Sat Sep 29, 2018 7:28 am
Immortal sniper could you provide a picture of it?
the picture was on factorio prints

immortal_sniper1
Fast Inserter
Posts: 176
Joined: Sun Jun 03, 2018 8:54 am

Re: 4-way intersections: Throughput and deadlocks [image heavy]

i will try to make some improvements 3 circle design with # in the middle

immortal_sniper1
Fast Inserter
Posts: 176
Joined: Sun Jun 03, 2018 8:54 am

Re: 4-way intersections: Throughput and deadlocks [image heavy]

immortal_sniper1
Fast Inserter
Posts: 176
Joined: Sun Jun 03, 2018 8:54 am

Re: 4-way intersections: Throughput and deadlocks [image heavy]

hansjoachim wrote:
Sat Sep 29, 2018 8:02 am
I took a look at your intersection.
4way 4 lanes with any train size
zero buffers
Set 1= 33 trains per min
Since it is a roundabout it can deadlock if trains change direction in the middle of the intersection.
One annoying problem is that two trains cant take right when coming from the same direction because you allow two routes for the inner lane.
The same problem occurs for straight as the outer lane has two routes for going straight. The shortest route would block trains in the inner lane for going straight and left.
At this throughput, two lanes would be better and save a lot of rails
above i posted an better design

hansjoachim
Fast Inserter
Posts: 103
Joined: Wed Apr 26, 2017 7:03 pm

Re: 4-way intersections: Throughput and deadlocks [image heavy]

immortal_sniper1 wrote:
Tue Oct 09, 2018 4:19 pm
above i posted an better design
I looked at the intersection, its better.
If you want to use in a busy area I belive that you should change a couple things.
There are still three major problems I want to adresse.
Left turns:
Trains on the inner lane have to first turn right, onto the outer lane, then turn left. This blocks trains on the outer lane to go straight or take left turn. Meaning every train taking a left turn blocks a train unnecesary.

Lane switching
If you have a 4 lane system you need some sort of lane switching. You can make some that dont bottleneck your network.
If it is to be in the intersection it should be one with buffers. It severly limits throughput.
Having even a bad lane switcher after the intersection instead of in it will increase throughput.

In the intersection you have every directions gets to drvie every fourth turn. idealy two trains then drive from that direction. If one of them wants to switch lanes only one train gets to drive. If this happens often it can halve the potential throughput.

U-turns

Its kind of the same with U-turns. If a train takes a U-turn it blocks many paths, if it did it out of the intersection it would block far less paths.

Sum,
Adding two buffers (red), removing the posibility to switch lanes and take U-turns (blue), and leting trains go directly left instead of going to the right first (green).
Attachments
InkedPicture of intersection_LI.jpg (2.69 MiB) Viewed 578 times
Here is my take on it, Letting as many trains as possible pass the intersection per round, buffering up all the directions. No unnecessary crossings, no U-turns.
My intersection demo.jpg (2.37 MiB) Viewed 584 times
Updated version of aaarghas intersection testbench. viewtopic.php?f=194&t=46855&p=383830#p383830
My Highscore intersections: https://pastebin.com/dGsJT71Z
My 3 to 1 train merger https://pastebin.com/AcLHXcwd

Hyenna
Inserter
Posts: 40
Joined: Mon May 14, 2018 6:49 am

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Nice work there with the tests.
Im suggesting a test that includes trains that want to turnaround and railchange.

hansjoachim
Fast Inserter
Posts: 103
Joined: Wed Apr 26, 2017 7:03 pm

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Hyenna wrote:
Sat Oct 13, 2018 9:23 pm
Nice work there with the tests.
Im suggesting a test that includes trains that want to turnaround and railchange.
That is possible on the test bench.
The only reason I see for adding it would be to show why you shouldn't allow U-turns or lane switching in your intersections.
Updated version of aaarghas intersection testbench. viewtopic.php?f=194&t=46855&p=383830#p383830
My Highscore intersections: https://pastebin.com/dGsJT71Z
My 3 to 1 train merger https://pastebin.com/AcLHXcwd

Hyenna
Inserter
Posts: 40
Joined: Mon May 14, 2018 6:49 am

Re: 4-way intersections: Throughput and deadlocks [image heavy]

hansjoachim wrote:
Sun Oct 14, 2018 3:42 pm
Hyenna wrote:
Sat Oct 13, 2018 9:23 pm
Nice work there with the tests.
Im suggesting a test that includes trains that want to turnaround and railchange.
That is possible on the test bench.
The only reason I see for adding it would be to show why you shouldn't allow U-turns or lane switching in your intersections.
Where do you suggest the turnaround to be done then?
I think its probably better at a crossing then in another place where they block traffic again. But it depends alot on the rest of the rail setup im sure.

Quad Rail Crossings.jpg (633.05 KiB) Viewed 518 times
The waiting line in front can be like this but should be aligned to the train length.
Neue Bitmap.jpg (130.87 KiB) Viewed 518 times

hansjoachim
Fast Inserter
Posts: 103
Joined: Wed Apr 26, 2017 7:03 pm

Re: 4-way intersections: Throughput and deadlocks [image heavy]

[/quote]

Where do you suggest the turnaround to be done then?
I think its probably better at a crossing then in another place where they block traffic again. But it depends alot on the rest of the rail setup im sure.

[/quote]

A rail networks capacity is defined by its bottlenecks not by how many intersections there are.
Adding lane switching to an intersection can be done without reducing throughput but most of the time people add them to the same "block". When that is done there are scenarios where very few trains can pass the block at the same time.

You can set up your network so that no trains have to switch lanes or take U turns.
If you have to I would have them between your 3/4 way intersections.
A good U turn intersection needs buffers before crossing every lane/merging.
Even better would be to let the trains turn around off the mainline.
Updated version of aaarghas intersection testbench. viewtopic.php?f=194&t=46855&p=383830#p383830
My Highscore intersections: https://pastebin.com/dGsJT71Z
My 3 to 1 train merger https://pastebin.com/AcLHXcwd

mrvn
Smart Inserter
Posts: 2573
Joined: Mon Sep 05, 2016 9:10 am

Re: 4-way intersections: Throughput and deadlocks [image heavy]

The best way for a turnaround would be to not cross any lanes. But above you have your lanes too near to each other so the turn around needs to first cross to the outer lanes and then cross back to the inner lanes.

Why not make the lanes further apart so you can put a turn around between the inner lanes directly?

PS: the lanes can come in to the intersection near to each other and then widen before the turn around.

zOldBulldog
Filter Inserter
Posts: 742
Joined: Sat Mar 17, 2018 1:20 pm

Re: 4-way intersections: Throughput and deadlocks [image heavy]

mrvn wrote:
Mon Oct 15, 2018 10:15 am
The best way for a turnaround would be to not cross any lanes. But above you have your lanes too near to each other so the turn around needs to first cross to the outer lanes and then cross back to the inner lanes.

Why not make the lanes further apart so you can put a turn around between the inner lanes directly?
Or if he doesn't want to modify his entry/exit to the intersection, use a technique similar to the one I used here:
turnaround.png (4.34 MiB) Viewed 486 times

Hyenna
Inserter
Posts: 40
Joined: Mon May 14, 2018 6:49 am

Re: 4-way intersections: Throughput and deadlocks [image heavy]

The connection of the inner and outer line in the turnaround part was planned to make rail change possible.
When i put that crossing in a diffrent place there would be another place where the trains have to wait (maybe less long per wait but more often)
which result in more travel time due to more break and start moving on actions and may result in more energy consumption. Less intersections where they could block each other means less traffic to pile up. (or that is what my thought was about)

mrvn
Smart Inserter
Posts: 2573
Joined: Mon Sep 05, 2016 9:10 am

Re: 4-way intersections: Throughput and deadlocks [image heavy]

zOldBulldog wrote:
Mon Oct 15, 2018 4:35 pm
mrvn wrote:
Mon Oct 15, 2018 10:15 am
The best way for a turnaround would be to not cross any lanes. But above you have your lanes too near to each other so the turn around needs to first cross to the outer lanes and then cross back to the inner lanes.

Why not make the lanes further apart so you can put a turn around between the inner lanes directly?
Or if he doesn't want to modify his entry/exit to the intersection, use a technique similar to the one I used here:

turnaround.png
That's exactly what I had in mind.

zOldBulldog
Filter Inserter
Posts: 742
Joined: Sat Mar 17, 2018 1:20 pm

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Here is another contribution to the list of 4-way intersections.

I have not benchmarked it but it is a variation on the Standard intersection (plus the return loops before entering the intersection) so I would expect it to clock around 60 and unless I messed up to have no deadlock potential.
tictactoe.jpg (394.68 KiB) Viewed 368 times

Forum discussion page: viewtopic.php?f=194&t=63066
Factorioprints page: https://factorioprints.com/view/-LPNlfISFe-D9aoDepBp

Description:

Designed with the goal of achieving a balance of compactness, high throughput and supporting any size trains.

Some considerations:

- The return loops on the inner lanes before entering the intersection help reduce traffic that goes through it. The same for the outer turns. Using similar loops on your lines will allow you to use mainly exit/merge/lane changes instead of intersections, which (at least for me) has significantly improved my network's ability to keep trains running at full speeds.

- It is Left Hand Drive (LHD). Why? Because even though in real life I drive on the right lane, I noticed that the left exit from trains makes LHD much more natural in Factorio, as LHD typically leaves the things you want to access on the side of the train that you exit. Also, LHD allows placing the signals on the inside, which leads to cleaner interactions between rail and neighboring belts/structures/water. So, after a little RHD use I ended up switching to LHD for my rails.

- You need lane changers (between inner and outer lanes) a train length away from this intersection. So, if you are using 4 locomotive 8 wagon trains you would roughly need between 2 1/2 to 3 chunks of straight rail before the lane changers.

hansjoachim
Fast Inserter
Posts: 103
Joined: Wed Apr 26, 2017 7:03 pm

Re: 4-way intersections: Throughput and deadlocks [image heavy]

zOldBulldog Intersection

Set 1 (random)= 49

set 2 (planned) = 41

Set 5 (right only) = 17

This is the result with a very good laneswitcher. With a poor one, set 1 and 2 would be lower.

Right turns are this intersection's main problem.

The right turns only test would have double the throughput if the center is fixed, which would also increase set 1 and 2.

In the center, all the lanes are in one block. Which doesn't allow train from north drive west, while trains from south drives east.
Attachments
zOldbulldog's intersection.png (7.26 MiB) Viewed 329 times
Last edited by hansjoachim on Tue Oct 23, 2018 5:29 am, edited 1 time in total.
Updated version of aaarghas intersection testbench. viewtopic.php?f=194&t=46855&p=383830#p383830
My Highscore intersections: https://pastebin.com/dGsJT71Z
My 3 to 1 train merger https://pastebin.com/AcLHXcwd

zOldBulldog
Filter Inserter
Posts: 742
Joined: Sat Mar 17, 2018 1:20 pm

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Thank you hansjoachim, I obviously messed it up when I moved things to support the returns and it resulted in those tight to each other turns in the center.

Would it be safe to assume that widening the intersection enough to put signals in the center would achieve that?

hansjoachim
Fast Inserter
Posts: 103
Joined: Wed Apr 26, 2017 7:03 pm

Re: 4-way intersections: Throughput and deadlocks [image heavy]

zOldBulldog wrote:
Mon Oct 22, 2018 9:29 pm

Would it be safe to assume that widening the intersection enough to put signals in the center would achieve that?
Yes, you can just expand the intersection by a few tiles
Updated version of aaarghas intersection testbench. viewtopic.php?f=194&t=46855&p=383830#p383830
My Highscore intersections: https://pastebin.com/dGsJT71Z
My 3 to 1 train merger https://pastebin.com/AcLHXcwd

zOldBulldog
Filter Inserter
Posts: 742
Joined: Sat Mar 17, 2018 1:20 pm

Re: 4-way intersections: Throughput and deadlocks [image heavy]

hansjoachim wrote:
Tue Oct 23, 2018 4:25 am
zOldBulldog wrote:
Mon Oct 22, 2018 9:29 pm

Would it be safe to assume that widening the intersection enough to put signals in the center would achieve that?
Yes, you can just expand the intersection by a few tiles
Done. With any luck maybe I managed to address that issue without creating any new problems.
bulldogTicTacToeIntersection.jpg (8.31 MiB) Viewed 285 times

hansjoachim
Fast Inserter
Posts: 103
Joined: Wed Apr 26, 2017 7:03 pm

Re: 4-way intersections: Throughput and deadlocks [image heavy]

There were many misplaced lights which butchered the throughput, also there were a lot of unnecessary lights.

I fixed it up and now it runs as best as it can.
set 1 (random) 61 trains/min
set 2 (planned 50% straight,15% left, 35% right) 49 trains/min
set 5 (right turns only) 35 trains/min

There are still some things I would want to change with it. Like not requiring trains to switch lanes back and forth, and also add another waiting area for trains going straight/right. Which would increase the throughput by 20-40%. It would have to be made first for me to tell exactly.

Here is the blueprint without the necesary laneswitcher. Also the distance from the main block to the second signal on the output lanes should be a train length.

Here is a blueprint of the laneswitcher used
Attachments
Oldbulldog improved intersection.jpg (341.57 KiB) Viewed 275 times
Updated version of aaarghas intersection testbench. viewtopic.php?f=194&t=46855&p=383830#p383830
My Highscore intersections: https://pastebin.com/dGsJT71Z
My 3 to 1 train merger https://pastebin.com/AcLHXcwd