Belt math, using lower tier belts to effect.
Forum rules
Circuit-free solutions of basic factory-design to achieve optimal item-throughput
- BlueTemplar
- Smart Inserter
- Posts: 3091
- Joined: Fri Jun 08, 2018 2:16 pm
- Contact:
Re: Belt math, using lower tier belts to effect.
Nice, I might use that, thanks !
BobDiggity (mod-scenario-pack)
Clarification on the term "balancing"
When looking at this thread, I feel the urge to clarify the term "balancing".
o1 = o2 = ... = om = o
If the combined rate of input equals the combined rate of output the transformation can be expressed as the following formula:
i1 + i2 + ... + in = o1 + o2 + ... + om = m*o
"Balancing" in the context of Factorio and in common language mostly is used when refering to the task to evenly distribute the items from a numer n of belts to another number m of belts. Former are referd to as input belts and the later ones as ouput belts. Sometimes "balancing" also is used for the problem to evenly distribute the items from the lanes of an input belt or input belts to the lanes of an ouput belt or output belts.
Balancing
"Balancing" in the context of Factorio means transforming one or several (n) rates of input (i1, i2, in) to one or several (m) rates of output (o1, o2, ... om), where all the rates of output are equal!o1 = o2 = ... = om = o
If the combined rate of input equals the combined rate of output the transformation can be expressed as the following formula:
i1 + i2 + ... + in = o1 + o2 + ... + om = m*o
Rate
"Balancing" in the context of Factorio and in common language mostly is used when refering to the task to evenly distribute the items from a numer n of belts to another number m of belts. Former are referd to as input belts and the later ones as ouput belts. Sometimes "balancing" also is used for the problem to evenly distribute the items from the lanes of an input belt or input belts to the lanes of an ouput belt or output belts.
Balancing problem
Balancer
Clarification on "ratio splitting"
Following up on the clarification on "balancing", I also want to clarify the term "ratio splitting".
i1 + i2 + ... + in = i
o1 = r1*i
o2 = r2*i
...
om = rm*i
Constraint for "balancing":
r1 = r2 = ... = rm = r
and thus
o1 = o2 = ... = om = o
Ratio splitting
"Ratio splitting" in the context of Factorio refers to the task of transforming one or several (n) rates of input (i1, i2, in) to one or several (m) rates of output (o1, o2, ... om), where the rates of output have fixed ratios (r1, r2, ... rm) compared to the combined input (i).i1 + i2 + ... + in = i
o1 = r1*i
o2 = r2*i
...
om = rm*i
Example
Relation of balancing and ratio splitting
Looking at the meaning of "balancing" and "ratio splitting" reveals, that balancing problems are a subset of ratio splitting problems with the constraint, that all output ratios have to be equal.Constraint for "balancing":
r1 = r2 = ... = rm = r
and thus
o1 = o2 = ... = om = o
Re: Belt math, using lower tier belts to effect.
What does the term 'throughput unlimited' mean?
Re: Belt math, using lower tier belts to effect.
It means feeding n compressed belts to any inputs allows drawing n compressed belts from any outputs.
Most balancers have have insufficient internal throughput and are therefore not throughput unlimited.
see https://wiki.factorio.com/Balancer_mechanics
and viewtopic.php?t=60561
I havn't used balancers myself in ages since i ran benchmarks on balancers made of splitters vs loaders with wide chests. Loader performance already is 50% better for balancing 4 belts.
My Mods: mods.factorio.com
Re: Belt math, using lower tier belts to effect.
And it seems to be impossible to make circuit-less balancers in vanilla that evenly distribute the input to unblocked outputs if one or more outputs is backed-up. That is my standard use case whenever i think about using a balancer instead of a priority splitter.Optera wrote: ↑Sat Aug 31, 2019 2:26 pm I havn't used balancers myself in ages since i ran benchmarks on balancers made of splitters vs loaders with wide chests. Loader performance already is 50% better for balancing 4 belts.
It is trivial to do that with loaders and wide chests/warehouses.
Re: Belt math, using lower tier belts to effect.
It is possible in vanilla. Rather bulky 2 lane version i posted earlier this thread: (viewtopic.php?f=202&t=74800&start=20#p453655)Oktokolo wrote: ↑Sat Aug 31, 2019 3:12 pmAnd it seems to be impossible to make circuit-less balancers in vanilla that evenly distribute the input to unblocked outputs if one or more outputs is backed-up. That is my standard use case whenever i think about using a balancer instead of a priority splitter.Optera wrote: ↑Sat Aug 31, 2019 2:26 pm I havn't used balancers myself in ages since i ran benchmarks on balancers made of splitters vs loaders with wide chests. Loader performance already is 50% better for balancing 4 belts.
It is trivial to do that with loaders and wide chests/warehouses.
Gif shows even input consumption with a 3/4 blocked output.
If I play modded I go with loaders like Optera, for the same reasons. (and Angels Warehouses instead of Wide Chests, because they look stunning:))
Re: Belt math, using lower tier belts to effect.
Well, even distribution for unblocked outputs is implicit if there is only one unblocked output.disentius wrote: ↑Sun Sep 01, 2019 11:38 amRather bulky 2 lane version i posted earlier this thread: (viewtopic.php?f=202&t=74800&start=20#p453655)Oktokolo wrote: ↑Sat Aug 31, 2019 3:12 pm And it seems to be impossible to make circuit-less balancers in vanilla that evenly distribute the input to unblocked outputs if one or more outputs is backed-up. That is my standard use case whenever i think about using a balancer instead of a priority splitter.
Gif shows even input consumption with a 3/4 blocked output.
The until now unseen belt balancer would have more than two inputs and more than two outputs. It would evenly balance inputs to unblocked outputs so that every unblocked output gets roughly the same (does not have to be count-perfect) amount of item throughput. Inputs are assumed to contain the same item type, so mixing order doesn't matter. Input and output lanes are assumed to be balanced already. So it is only about balancing belts - not lanes.
Re: Belt math, using lower tier belts to effect.
Well... be specific. What do you want, exactly?
Saying something can't be done without being precise is not very informative. Showed you that your initial statement:
You obviously did not test it. Go ahead, try blocking/consuming in every variation, THEN tell me what is wrong. Dismissing a build without testing is not the factorio way.
Saying something can't be done without being precise is not very informative. Showed you that your initial statement:
is not true, by building a concept for two belts.Oktokolo wrote: ↑Sat Aug 31, 2019 3:12 pm ...
And it seems to be impossible to make circuit-less balancers in vanilla that evenly distribute the input to unblocked outputs if one or more outputs is backed-up. That is my standard use case whenever i think about using a balancer instead of a priority splitter.
It is trivial to do that with loaders and wide chests/warehouses.
You obviously did not test it. Go ahead, try blocking/consuming in every variation, THEN tell me what is wrong. Dismissing a build without testing is not the factorio way.
Re: Belt math, using lower tier belts to effect.
I am searching for a circuit-free belt balancer (not a lane balancer) with four input belts and four output belts.
Whenever there are items available on one of the inputs, they should be distributed evenly to all non-backed-up outputs. So that balancer would act like a balancer of four input belts to N output belts for N = zero to four depending on how many of the four output belts are able to receive items (are not backed up).
I chose the four-belt version, because i assume, that it could be used as a building block to build back-up-aware belt balancers for arbitrary amounts of inputs and outputs.
Re: Belt math, using lower tier belts to effect.
@disentius:
I studied the designs you presented here viewtopic.php?f=202&t=74800&start=20#p453655 . You show a 2>>2 balancer, that has a 2>>2 mixer and 2 output AND input lane balancers included. Very nice.
BUT I have the suspicion, that the mixture of those components can not be generalized to every n>>m problem. And let's leave the mixing and lane balancing part out. Let's just look at the belt balancing. Without the mixing and lane balancing parts, the design you showed is "just" a 2>>2 belt balancer. In the case of a 2>>2 belt balancer, which is a vanilla Factorio splitter, it is easy to evenly "distribute" the input to the other output"s", if one ouput is disconnected (or the belt at that output is backlogging), as there is just one "other" output.
In my experience every n>>m problem where y outputs are (partially) blocked, becomes temporarily an n>>(m-y) problem, for which to solve, a completely different balancer is required.
I tested the standard designs of an 8>>8 and of a 4>>4. They are not capable of balancing to (m-y) outputs. You might argue, that a completely different balancer is required, more complex, which can handle every case. But I doubt that such a solution exists. Looking at 8>>8 and 4>>4 balancers and their output behavior, when 1 output is blocked, it becomes apparent, that the culprit is the fact, that only the vanilla Factorio splitter, which is a 2>>2 balancer, can be used to split, mix and combine the contents of belts. For 2 outputs of an n>>m, there is always 1 "last" splitter inside the balancer. "Last" in the sense of "the last splitter before those 2 outputs". If one of the outputs is blocked, the other output gets ALL the inputs from that splitter, not just one half of it.
What are your thoughts?
I studied the designs you presented here viewtopic.php?f=202&t=74800&start=20#p453655 . You show a 2>>2 balancer, that has a 2>>2 mixer and 2 output AND input lane balancers included. Very nice.
BUT I have the suspicion, that the mixture of those components can not be generalized to every n>>m problem. And let's leave the mixing and lane balancing part out. Let's just look at the belt balancing. Without the mixing and lane balancing parts, the design you showed is "just" a 2>>2 belt balancer. In the case of a 2>>2 belt balancer, which is a vanilla Factorio splitter, it is easy to evenly "distribute" the input to the other output"s", if one ouput is disconnected (or the belt at that output is backlogging), as there is just one "other" output.
In my experience every n>>m problem where y outputs are (partially) blocked, becomes temporarily an n>>(m-y) problem, for which to solve, a completely different balancer is required.
I tested the standard designs of an 8>>8 and of a 4>>4. They are not capable of balancing to (m-y) outputs. You might argue, that a completely different balancer is required, more complex, which can handle every case. But I doubt that such a solution exists. Looking at 8>>8 and 4>>4 balancers and their output behavior, when 1 output is blocked, it becomes apparent, that the culprit is the fact, that only the vanilla Factorio splitter, which is a 2>>2 balancer, can be used to split, mix and combine the contents of belts. For 2 outputs of an n>>m, there is always 1 "last" splitter inside the balancer. "Last" in the sense of "the last splitter before those 2 outputs". If one of the outputs is blocked, the other output gets ALL the inputs from that splitter, not just one half of it.
What are your thoughts?
Re: Belt math, using lower tier belts to effect.
Thank you both for clearing up the details
I agree. There is no solution that i know of for even distribution in all cases possible for a 4-4 balancer.
I agree. There is no solution that i know of for even distribution in all cases possible for a 4-4 balancer.
Re: Belt math, using lower tier belts to effect.
My first attempt is a spectacular failure as what's mixed in the first phase is separated in the second! Blocking different outputs causes mixing but as soon as all are opened again the mixing ceases.
Re: Belt math, using lower tier belts to effect.
@Trebor:
In general I think, what a mixer has to look like, always depends on, in what pattern the items are supplied on the input side. I think there is no mixer which reliably mixes every input pattern.
In the case of this design you show, where the item types are separated by input belts
the belts, mixed in the 1st phase, need to be split by lanes in the 2nd phase.
That is my brute force attempt for a 4>>4 balancer and mixer for item types separated by input belts. The picture is also showing different rates of input (i1,i4=45, i2=15, i3=30). The parts, marked in green, are the lane splitters.
In general I think, what a mixer has to look like, always depends on, in what pattern the items are supplied on the input side. I think there is no mixer which reliably mixes every input pattern.
In the case of this design you show, where the item types are separated by input belts
the belts, mixed in the 1st phase, need to be split by lanes in the 2nd phase.
That is my brute force attempt for a 4>>4 balancer and mixer for item types separated by input belts. The picture is also showing different rates of input (i1,i4=45, i2=15, i3=30). The parts, marked in green, are the lane splitters.
Re: Belt math, using lower tier belts to effect.
Here's my second attempt.
Note each belt has the same ratio of items just in different lanes. I've also tested this by blocking different output belts and it only glitches during the transition.
Note each belt has the same ratio of items just in different lanes. I've also tested this by blocking different output belts and it only glitches during the transition.
Re: Belt math, using lower tier belts to effect.
I had to increase the length of the output lanes to check the ratios when input is starved but it looks like the ratios are the same in each lane. Note the output is always a repeating pattern of 4 copper, 4 iron, 2 coal, 2 blank (it's probably 6 blank but I can only see when several are consecutive).
Edit: Added BP.Re: Belt math, using lower tier belts to effect.
Turns out you are right. Ratios change when both inputs are starved and outputs are backed up. I think I know the reason. When inputs are starved empty spaces are are introduced if the balancer is throughput unlimited the empty spaces are passed to the outputs, this retains ratios by replacing an item with an empty space. When just the outputs are backed up the balancer becomes throughput limited. So when inputs are starved and outputs are blocked the empty spaces introduced are removed which changes the ratios of items within the balancer.
Display rows top/down are belts top/down. Columns left to right: Coal, Copper, Iron, Stone. Second belt is stopped in this pic.
Display rows top/down are belts top/down. Columns left to right: Coal, Copper, Iron, Stone. Second belt is stopped in this pic.
Re: Belt math, using lower tier belts to effect.
yep. Any uneven input or output screws it up.
Re: Belt math, using lower tier belts to effect.
I stand corrected:)