Hell.
Quick question.
If there is factory with multiply output inserters. What is the mechanism those inserters use to take out from factory. Do they took equal share or is it random?
Multiple outputs from factory. Inserters priority question.
- impetus maximus
- Smart Inserter
- Posts: 1299
- Joined: Sat Aug 20, 2016 10:07 pm
- Contact:
Re: Multiple outputs from factory. Inserters priority question.
setting up an assembler to make gears it cycled the output inserters South, West, East, and North.
it repeated the same order every 4 gears.
it repeated the same order every 4 gears.
Re: Multiple outputs from factory. Inserters priority question.
So it ensures that output goes equally to all inserters. Great.
Re: Multiple outputs from factory. Inserters priority question.
following up; if there are different -speed- inserters attached to an assembler, do the faster inserts get served before the slower ones? assume yellow and blue inserters.
- impetus maximus
- Smart Inserter
- Posts: 1299
- Joined: Sat Aug 20, 2016 10:07 pm
- Contact:
Re: Multiple outputs from factory. Inserters priority question.
there will be a bias towards the faster inserter, but it still seems to share with the slower ones. tested in 0.15.21 with 'Creative Mode', and 'Nixie Tubes' mods.Tym wrote:following up; if there are different -speed- inserters attached to an assembler, do the faster inserts get served before the slower ones? assume yellow and blue inserters.
[edit] the bias only happened when the output was faster than the standard inserters could keep up with. with a lvl 1 making gears it was 1:1:1:1
with a lvl 2 assembler the fast inserter output more gears than a standard one. [/edit]
screenshot
Re: Multiple outputs from factory. Inserters priority question.
My guess would be that each inserter checks if there is anything to remove from the factory, and if not, adds itself to a wakeup queue associated with the factory. This just happens to give balanced behaviour with multiple same-speed inserters: they will probably start off cycling in the order they were built (since the first one to be built added itself to the queue first), and since they all take the same time to cycle back to their starting position, they will always reinsert themselves into the queue in the same sequence. If the inserters aren't the same speed, the faster ones might "jump the queue" ahead of a slower inserter which is still in the process of swinging.
If that's how it works (which seems likely to me given the observed behaviour and past dev comments about wakeup queues in the engine) then it's guaranteed that each inserter will get *some* amount of product (none will be completely starved) but you aren't guaranteed to get an even split in all cases even if the inserters are the same speed: for example if the inserters have a stack size of 2 and the factory produces 3 items in the time it takes the inserters to cycle once, then one of the inserters will always pick up 2 items and the other will always pick up 1, leading to unbalanced output.
If that's how it works (which seems likely to me given the observed behaviour and past dev comments about wakeup queues in the engine) then it's guaranteed that each inserter will get *some* amount of product (none will be completely starved) but you aren't guaranteed to get an even split in all cases even if the inserters are the same speed: for example if the inserters have a stack size of 2 and the factory produces 3 items in the time it takes the inserters to cycle once, then one of the inserters will always pick up 2 items and the other will always pick up 1, leading to unbalanced output.
Re: Multiple outputs from factory. Inserters priority question.
Hm, actually, it might not be starvation-free: it depends on the order of evaluation. It might be possible for an inserter that returns to its starting position on the exact same tick that the factory produces an item to "jump the queue" if that happens to be processed before the wakeups happen, because I don't think machines go into the queue if their inputs are already available (as that would be wasteful). That seems like a tricky experiment to set up..
- Ranakastrasz
- Smart Inserter
- Posts: 2175
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: Multiple outputs from factory. Inserters priority question.
Really? When did this get added. I've been irritated since i started having multiple output directions that one inserter hogs the entire output till it backs up.
Gotta re-test this.
Gotta re-test this.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16