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.
aaargha
Filter Inserter
Filter Inserter
Posts: 333
Joined: Wed Dec 07, 2016 8:35 am
Contact:

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

Post by aaargha »

Divaya wrote:Sure, I'll work on the design a little more. I definitely like the idea of allowing multiple trains to make left turns in the intersection.

Edit: Not as hard as I imagined it'd be! Here's the second iteration of the intersection, and it allows opposing trains to make left turns at the same time.

*images*

I tried a similar approach on the 4.5 guage rail distances, but I had trouble with tight areas around the left turns that made it unfeasible to signal.
Added as Traditional with some slight signalling changes, I'd advise you to be careful with the double rail signals on exits, as they're so close trains may stop in the intersection if the output backs up. Throughput is very reasonable considering its size, it does become about five times wider, and taller, with the lane changers I'm using though :)
Zijkhal wrote:So, I've done a bit of testing with the Pasta because I was dissatisfied with the 66 / 73 throughput values, and found that it can actually do up to 83 / 85. The problem is the exit of the intersection. With leaving a train's length after the exit, trains follow very far behind each other, limiting the throughput. With using the one signal every two cars method, the throughput improved to 80 in set 1. At this point I realized that the higher throughput I was consistently measuring was due to me putting signals as close to each other as possible on the exit line, so trains were following each other closer.
Anyway, I was thinking, does the 1 train long rail block has to be right after the exit merge of the intersection? As trains accelerate, there could easily be a gap longer than one train between them, and it could be used to unlimit the throughput while maintaining the behaviour that trains only exit the intersection if they can fully leave the exit merge, thus not blocking the entry, and not degrading the rating to B.

So, I have created this: https://pastebin.com/Dmq0Xvyh
In three trains length it ensures that trains only exit the intersection if they can fully leave it, but it does not limit the throughput of the exit line.

Aargha, could you please retest the Pasta with this merge thing attached?
While this kind of optimization can be powerful it also limits the intersection to one train size. If we use different train sizes we may end up in situations like below where trains can park in the intersection if an output backs up.
mixed.png
mixed.png (112.82 KiB) Viewed 11612 times
I will not allow this kind of optimization as I feel that A) fixing train size is too limiting, and B) I'd have to redo all tests for the comparisons to be fair.

However if you're OK with fixing trains to one length then you can also modify this optimization to work on the internal buffers of the intersection. If trains are a fixed size you may also disregard the train-length output block in some situations if the distance between intersections is a multiple of the train length. I've been meaning to make a post on these kinds of optimizations for a while now but I keep getting distracted by other projects :)
User avatar
Tallinu
Fast Inserter
Fast Inserter
Posts: 143
Joined: Sun Jun 14, 2015 8:14 am
Contact:

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

Post by Tallinu »

Zijkhal wrote:Anyway, I was thinking, does the 1 train long rail block has to be right after the exit merge of the intersection?
Merges do not require a full-length exit block. As you've found, they perform better if the first few blocks are quite short, on the order of 3-7 track tiles. Block length can scale up with distance from the merge as train speeds will have increased and the gap between two trains will be wider (but any very high traffic area will typically perform better with blocks no longer than 7 tiles, or maybe 14 if you expect consistently high speeds -- exactly two or four car-lengths, respectively).

Unfortunately if a merge is too close to an intersection you can't do this without risking deadlocks. And a merge containing a full-train-length block results in decidedly sub-optimal throughput.

This is why the junctions I've posted since finding this thread (with rare exceptions) include enough buffer space after all intersections so that all trains can stop if necessary and wait for their turn to merge without risk of blocking intersections. It makes the minimum size of the junction longer, but it also has the benefit that you don't need to provide additional anti-deadlock buffer space between one such junction and any other junction of any type! The built-in buffer spaces do that job already! :D
Zijkhal wrote:So, I have created this:
If you're adding on something that long, you'd be better off just adding that one train-length of buffer space after the last intersection and moving the merge to the end of that buffer. It'd be shorter than that bluerpint and wouldn't have any reliance on train length. ;)

(Some slight digression: Merges could perform significantly better if train stopping / speed control logic included a little bit of prediction regarding other trains moving through blocks the train needs to enter, checking its speed and position to predict when the block will become clear, but who knows if that will ever happen. The only existing way I know of to improve merge throughput is with circuit-controlled signals, and it's far from perfect.)
Zijkhal
Inserter
Inserter
Posts: 25
Joined: Thu Sep 07, 2017 4:32 pm
Contact:

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

Post by Zijkhal »

aaargha wrote: I will not allow this kind of optimization as I feel that A) fixing train size is too limiting, and B) I'd have to redo all tests for the comparisons to be fair.
Fair enough.

Well, then, here are my "fixes" for that:

The Mk II: https://pastebin.com/qFmsfJRW
Same size, but has more than one crossing on the left turning lanes after a buffer.

The Mk III: https://pastebin.com/VpZk3Yh6
Larger, if I am not mistaken, this is the only intersection that includes a buffer before and after every crossing. I am not sure about the throughput gains over the above one, however...
User avatar
Divaya
Burner Inserter
Burner Inserter
Posts: 17
Joined: Mon Nov 06, 2017 3:57 am
Contact:

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

Post by Divaya »

aaargha wrote: Added as Traditional with some slight signalling changes, I'd advise you to be careful with the double rail signals on exits, as they're so close trains may stop in the intersection if the output backs up. Throughput is very reasonable considering its size, it does become about five times wider, and taller, with the lane changers I'm using though :)
What do the lane changers you're using look like?
aaargha
Filter Inserter
Filter Inserter
Posts: 333
Joined: Wed Dec 07, 2016 8:35 am
Contact:

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

Post by aaargha »

Divaya wrote:What do the lane changers you're using look like?
I'm using the ones Tallinu designed a while back, I've added that to the OP.
Zijkhal wrote:
aaargha wrote: I will not allow this kind of optimization as I feel that A) fixing train size is too limiting, and B) I'd have to redo all tests for the comparisons to be fair.
Fair enough.

Well, then, here are my "fixes" for that:

The Mk II: https://pastebin.com/qFmsfJRW
Same size, but has more than one crossing on the left turning lanes after a buffer.

The Mk III: https://pastebin.com/VpZk3Yh6
Larger, if I am not mistaken, this is the only intersection that includes a buffer before and after every crossing. I am not sure about the throughput gains over the above one, however...
And oh boy, did those fixes pay off, both the MKII and the MKIII are among the top designs so far, great job! :)

The only thing I did was to lengthen a few of the output buffers that were a few pixels too short:
too-short.png
too-short.png (182.71 KiB) Viewed 11574 times
In other news, the OP is now about two thirds of the post limit, I'm both anticipating and dreading us getting there :D
Zijkhal
Inserter
Inserter
Posts: 25
Joined: Thu Sep 07, 2017 4:32 pm
Contact:

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

Post by Zijkhal »

aaargha wrote: And oh boy, did those fixes pay off, both the MKII and the MKIII are among the top designs so far, great job! :)
Yes! My life is complete :D
aaargha wrote: The only thing I did was to lengthen a few of the output buffers that were a few pixels too short:
too-short.png
Crap. Noobie mistake.

but I'm wondering, does lengthening those buffers so they can fit ~7 cars make sense, so the average crossing speed of the 6 car trains will be faster?
aaargha
Filter Inserter
Filter Inserter
Posts: 333
Joined: Wed Dec 07, 2016 8:35 am
Contact:

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

Post by aaargha »

It might, the only way to be sure is to measure it. I might set up some small test to try to do that after I've finished my current project:
I should not be allowed to design things
If I still have my sanity when I'm done I'll take a look at some simple buffer length tests.
ElderAxe
Fast Inserter
Fast Inserter
Posts: 153
Joined: Thu May 18, 2017 8:04 am
Contact:

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

Post by ElderAxe »

Can you please test this one?
BLUEPRINT
IMAGE
Last edited by ElderAxe on Tue Nov 14, 2017 11:06 am, edited 2 times in total.
User avatar
Tallinu
Fast Inserter
Fast Inserter
Posts: 143
Joined: Sun Jun 14, 2015 8:14 am
Contact:

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

Post by Tallinu »

Zijkhal wrote:
aaargha wrote: And oh boy, did those fixes pay off, both the MKII and the MKIII are among the top designs so far, great job! :)
Yes! My life is complete :D
aaargha wrote: The only thing I did was to lengthen a few of the output buffers that were a few pixels too short:
too-short.png
Crap. Noobie mistake.

but I'm wondering, does lengthening those buffers so they can fit ~7 cars make sense, so the average crossing speed of the 6 car trains will be faster?
aaargha wrote:It might, the only way to be sure is to measure it. I might set up some small test to try to do that after I've finished my current project:
I should not be allowed to design things
If I still have my sanity when I'm done I'll take a look at some simple buffer length tests.
I've done tests along those lines and posted the results a few pages back. On mobile so hard to go find them, but some extra space definitely does make intersections available sooner. Depending on train length and braking speed. The test trains can benefit from up to around 7 track tiles of extra stopping space if I remember right.
aaargha
Filter Inserter
Filter Inserter
Posts: 333
Joined: Wed Dec 07, 2016 8:35 am
Contact:

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

Post by aaargha »

DarkElder wrote:Can you please test this one?
Added as "Almost squareabout", the unresolvable deadlock is a 4-way right-to-straight path change on the outer lanes.
Tallinu wrote:I've done tests along those lines and posted the results a few pages back. On mobile so hard to go find them, but some extra space definitely does make intersections available sooner. Depending on train length and braking speed. The test trains can benefit from up to around 7 track tiles of extra stopping space if I remember right.
Oh right, I'd forgotten about that, sorry. I believe this is the post.
User avatar
Tallinu
Fast Inserter
Fast Inserter
Posts: 143
Joined: Sun Jun 14, 2015 8:14 am
Contact:

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

Post by Tallinu »

Yep, that's the one. Because the effect is greatest for the first few pieces of added track, even a small amount of extra space can make a big difference, but there is that minimum crossing time to consider. Now all of those tests were done using the testbed map which has full braking force researched and the trains were all running on rocket fuel, so there may be worse performance in real game situations if either of those things are not true -- lower braking force would increase braking distance, requiring more extra track to get the most benefit, and running on coal or solid fuel might reduce acceleration and make minimum crossing time higher as well. I hadn't thought to run those tests using other fuel types, but it should be easy enough, I had included a blueprint for the measurement rig I was using.
User avatar
ridesdragons
Inserter
Inserter
Posts: 28
Joined: Sun Feb 05, 2017 9:30 am
Contact:

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

Post by ridesdragons »

aaargha wrote:
I should not be allowed to design things
you made a castle lol. I actually like that design. I'm gonna have to show some of my friends lol
ElderAxe
Fast Inserter
Fast Inserter
Posts: 153
Joined: Thu May 18, 2017 8:04 am
Contact:

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

Post by ElderAxe »

aaargha wrote:
DarkElder wrote:Can you please test this one?
Added as "Almost squareabout", the unresolvable deadlock is a 4-way right-to-straight path change on the outer lanes.
There shouldn't be a deadlock on the outer square. It's not a big square roundabout. trains can only go straight using that outer lanes.

Also i made an OCD friendly version of the same design. That would be great if you add this one too.
OCD Friendly Version
mrvn
Smart Inserter
Smart Inserter
Posts: 5865
Joined: Mon Sep 05, 2016 9:10 am
Contact:

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

Post by mrvn »

DarkElder wrote:Can you please test this one?
IMAGE
Why isn't it symetrical? That usualy means you get one speed in one orientation and another when you rotate it.
ElderAxe
Fast Inserter
Fast Inserter
Posts: 153
Joined: Thu May 18, 2017 8:04 am
Contact:

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

Post by ElderAxe »

mrvn wrote:
DarkElder wrote:Can you please test this one?
IMAGE
Why isn't it symetrical? That usualy means you get one speed in one orientation and another when you rotate it.
The one on my previous post is symetrical. OCD Friendly Version
Jap2.0
Smart Inserter
Smart Inserter
Posts: 2377
Joined: Tue Jun 20, 2017 12:02 am
Contact:

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

Post by Jap2.0 »

The "I don't know what to call this - Mk. 1"

This is somewhat of a roundabout while somewhat not. Trains can only go straight and right, but can turn around after the intersection, so a right turn can either be straight, then right or right, then straight. I have no idea if this will deadlock or how well it will do.
Image
Blueprint string
There are 10 types of people: those who get this joke and those who don't.
Zijkhal
Inserter
Inserter
Posts: 25
Joined: Thu Sep 07, 2017 4:32 pm
Contact:

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

Post by Zijkhal »

Jap2.0 wrote:The "I don't know what to call this - Mk. 1"

This is somewhat of a roundabout while somewhat not. Trains can only go straight and right, but can turn around after the intersection, so a right turn can either be straight, then right or right, then straight. I have no idea if this will deadlock or how well it will do.
Image
I think you should try widening the straight going tracks at the entry / exit, so the turnaround tracks dont have to cross it, which could improve throughput. Also, I'd merge all three lanes as close to each other as I can, and use chain signals for all three instead of merging two and then a chain signal when merging with the straight one.
Jap2.0
Smart Inserter
Smart Inserter
Posts: 2377
Joined: Tue Jun 20, 2017 12:02 am
Contact:

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

Post by Jap2.0 »

Zijkhal wrote:
Jap2.0 wrote:The "I don't know what to call this - Mk. 1"

This is somewhat of a roundabout while somewhat not. Trains can only go straight and right, but can turn around after the intersection, so a right turn can either be straight, then right or right, then straight. I have no idea if this will deadlock or how well it will do.
Image
I think you should try widening the straight going tracks at the entry / exit, so the turnaround tracks dont have to cross it, which could improve throughput. Also, I'd merge all three lanes as close to each other as I can, and use chain signals for all three instead of merging two and then a chain signal when merging with the straight one.
Okay, I hadn't thought of doing the turnaround in the middle. As for the merging, some of the spacing was a bit weird, so fixing that would definately help. I'll keep all that in mind for mk. 2. Thanks!
There are 10 types of people: those who get this joke and those who don't.
gremblor
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun Nov 26, 2017 8:46 am
Contact:

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

Post by gremblor »

I really like Tallinu's multicross design, but I run a 4-track 3-8-3 (14 car) rail network, and his blueprints for this train length are only available in 2-track form... I built a 4-lane RHD multicross scaled up to 14 car buffers, available here: https://factorioprints.com/view/-KzrTRj_P9IqOK9K8ryQ
User avatar
Tallinu
Fast Inserter
Fast Inserter
Posts: 143
Joined: Sun Jun 14, 2015 8:14 am
Contact:

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

Post by Tallinu »

gremblor wrote:I really like Tallinu's multicross design, but I run a 4-track 3-8-3 (14 car) rail network, and his blueprints for this train length are only available in 2-track form... I built a 4-lane RHD multicross scaled up to 14 car buffers, available here: https://factorioprints.com/view/-KzrTRj_P9IqOK9K8ryQ
Actually, you can find the original, slightly older, 4 lane version of the Multicross in the first post of the thread, right at the top of the 4-lane "A" section. ;) There's only the LHD version of what I'd now call a partially "extended" layout, which contains a couple of extra buffer zones that aren't really worth the extra space with longer trains, though.

I had intended to polish up some rescaled blueprints for both RHD and LHD (of the non-extended version, since there's so little point to the extension in anything but a throughput test environment) and add them to my drive folder with the others... But I've just been too busy and stressed with life and other things, unfortunately.

I'm pleased to hear that you like the design enough to do that much work on it yourself though. :)
Locked

Return to “Railway Setups”