In other languages: Deutsch Nederlands Polska Русский 中文

Balancer mechanics: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
m (→‎See also: added link)
m (→‎Throughput: <code> tag instead of abusing key template)
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Languages}}
{{Languages}}
Balancers are used to evenly distribute items over multiple belts or multiple belt lanes.
Balancers are used to evenly distribute items over multiple belts or multiple belt lanes.
Balancers that are input balanced take evenly from all input belts/belt lanes. Balancers that are output balanced distribute evenly to all output belts/belt lanes. Ideally, a balancer should be input and output balanced.


== Belt balancers ==
== Belt balancers ==


[[File:Balancer_Mechanics1.png|thumb|200px|right|1 full input belt gets split into two 50% full belts which get split into 4 belts that are each 25% full.]]
[[File:Balancer_Mechanics1.png|thumb|200px|right|1 full input belt gets split into two 50% full belts which get split into 4 belts that are each 25% full.]]
Belt balancers use the mechanic that splitters output items in a 1:1 ratio onto both their output belts. That means that a splitter can be used to put an equal amount of items on two belts. Since the process can be repeated infinitely, balancers with 2<sup>n</sup> output belts are easy to create.  
Belt balancers utilize the mechanic that splitters output items in a 1:1 ratio onto both their output belts. That means that a splitter can be used to put an equal amount of items on two belts. Since the process can be repeated infinitely, balancers with 2<sup>n</sup> output belts are easy to create.  
{{clear}}
{{clear}}
[[File:Balancer_Mechanics2b.png|thumb|450px|right|First the belts A and B go through a splitter so that the output belts contain an equal amount of items from each input belt (AB). The same is done with belts C and D. Then the mixed belts AB and CD go through splitters so that their output belts contain items from each input belt (ABCD)!]]
[[File:Balancer_Mechanics2b.png|thumb|450px|right|First the belts A and B go through a splitter so that the output belts contain an equal amount of items from each input belt (AB). The same is done with belts C and D. Then the mixed belts AB and CD go through splitters so that their output belts contain items from each input belt (ABCD)!]]
Line 12: Line 14:


=== Throughput ===
=== Throughput ===
[[File:4to4_balancer_throughput_limit_demo.gif|right|384px]]
[[File:4to4_balancer_throughput_limit_demo.gif|right|262px]]
Often, balancers are '''throughput limited'''. To be '''throughput ''un''limited''', a balancer must fulfil the following conditions:
Balancers that are '''throughput limited''' may not be able to provide maximum output if one or more outputs are blocked. To be '''throughput ''un''limited''', a balancer must fulfil the following conditions:
#100% throughput under full load.
#100% throughput under full load.
#Any arbitrary amount of input belts should be able to go to any arbitrary amount of output belts.
#Any arbitrary amount of input belts should be able to go to any arbitrary amount of output belts.


Balancers often do not fulfill the second condition because of internal bottlenecks. The gif on the right shows a 4 &rarr; 4 balancer being fed by two belts, but only outputting one belt which means that its througput in that arrangement is 50%. The bottleneck in this balancer is that the two middle belts only get input from one splitter. So, if only one side of that splitter gets input, as can be seen in the gif, it can only output one belt even though the side of the splitter is fed by a splitters which gets two full belts of input. In this particular case, the bottleneck can be fixed by feeding the two middle output belts with more splitters. This is done by adding two more splitters at the end of the balancer, as it can be seen here: [[File:4to4_balancer.png|center|125px]]
Balancers often do not fulfill the second condition because of internal bottlenecks. The gif on the right shows a 4 &rarr; 4 balancer being fed by two belts, but only outputting one belt which means that its throughput in that arrangement is 50%. The bottleneck in this balancer is that the two middle belts only get input from one splitter. So, if only one side of that splitter gets input, as can be seen in the gif, it can only output one belt even though the side of the splitter is fed by a splitters which gets two full belts of input. In this particular case, the bottleneck can be fixed by feeding the two middle output belts with more splitters. This is done by adding two more splitters at the end of the balancer, as it can be seen here: [[File:4to4_balancer.png|center|125px]]


However most balancers' bottlenecks can't be solved as easily. A guaranteed method to achieve throughput unlimited balancers is to place two balancers back to back that fulfil the first condition for throughput unlimited balancers (100% throughput under full load). The resulting balancer is usually larger than a balancer that was initially designed to be throughput unlimited. This is the case because they use more splitters than the minimum required amount of {{Key|n×log<sub>2</sub>(n)−n÷2}} <sub>(where n is the (power-of-two) number of belts)</sub> splitters for a throughput unlimited balancer.
However most balancers' bottlenecks can't be solved as easily. A guaranteed method to achieve throughput unlimited balancers is to place two balancers back to back that fulfil the first condition for throughput unlimited balancers (100% throughput under full load). The resulting balancer is usually larger than a balancer that was initially designed to be throughput unlimited. This is the case because they use more splitters than the minimum required amount of splitters for a throughput unlimited balancer. For n &rarr; n balancers where n is a power of two numbers, <code>n×log<sub>2</sub>(n)−n÷2</code> can be used to calculate how many splitters are needed. This formula is based on the number of nodes in a [[WIKIPEDIA:Clos_network#Bene%C5%A1_network_(m_=_n_=_2)|Beneš network]], which is essentially the same as a throughput unlimited balancer — it allows any input to reach any output.
{{clear}}
 
=== Universal balancers ===
Many balancers fail to balance properly once an output backs up or if an output is not used. In essence this means that an n-n balancer is not a functional n-(n-1) balancer. Sometimes this can be fixed by looping the unused output back around the balancer and distributing it among the inputs. Other times, this is not an option. Universal balancers solve this issue by having the back-looping built in. These balancers can balance evenly between any inputs and any outputs. Universal balancers can be throughput limited. If a universal balancer is throughput limited, the bottleneck may be in the loops or the balancer itself. A throughput limited universal balancer may only have the capacity for a few unused outputs. When more than the number of allowed outputs backs up, the universal balancer behaves like a normal balancer, and may not balance properly. {{clear}}


== Lane balancers ==
== Lane balancers ==
[[File:Lane_balancer_mechanics.png|thumb|right|The items are evenly sideloaded onto the output belt, achieving output balance.]]
[[File:Lane_balancer_mechanics.png|thumb|right|This output balanced lane balancer distributes the items evenly among the output lanes, achieving output balance.]]
Lane balancers evenly distribute input items onto the output lanes and evenly take them from the input lanes.{{clear}}
Lane balancers may be output balanced or input balanced. Input balanced lane balancers draw evenly from each side of the input belt, while output balanced lane balancers output evenly onto each lane of the output belt. {{clear}}


== See also ==
== See also ==
Line 31: Line 35:
** [[Transport belts]]
** [[Transport belts]]
** [[Underground belts]]
** [[Underground belts]]
* [https://gist.github.com/Bilka2/aeec4ff7123ff5544cb9a80cf1046a06 Balancer blueprint archive]
== Further reading ==
* [https://forums.factorio.com/34182 Command line belt balancer analyzer]
* [https://forums.factorio.com/viewtopic.php?p=344279#p344279 Fractal (2<sup>n</sup>) balancer generation tool]
* [https://forums.factorio.com/61424 Belt Balancers - how they work and how to make them]
* [https://forums.factorio.com/63462 Finding balance: A guide to belt balancers]

Latest revision as of 11:18, 23 November 2020

Balancers are used to evenly distribute items over multiple belts or multiple belt lanes.

Balancers that are input balanced take evenly from all input belts/belt lanes. Balancers that are output balanced distribute evenly to all output belts/belt lanes. Ideally, a balancer should be input and output balanced.

Belt balancers

1 full input belt gets split into two 50% full belts which get split into 4 belts that are each 25% full.

Belt balancers utilize the mechanic that splitters output items in a 1:1 ratio onto both their output belts. That means that a splitter can be used to put an equal amount of items on two belts. Since the process can be repeated infinitely, balancers with 2n output belts are easy to create.

First the belts A and B go through a splitter so that the output belts contain an equal amount of items from each input belt (AB). The same is done with belts C and D. Then the mixed belts AB and CD go through splitters so that their output belts contain items from each input belt (ABCD)!

Balancers also use the mechanic that splitters take an equal amount of items from both input belts. That means that a splitter connected to two input belts will evenly distribute those items onto the the two output belts. To balance belts it has to be made sure that the output belts contain an equal number of items from each input belt.

Throughput

4to4 balancer throughput limit demo.gif

Balancers that are throughput limited may not be able to provide maximum output if one or more outputs are blocked. To be throughput unlimited, a balancer must fulfil the following conditions:

  1. 100% throughput under full load.
  2. Any arbitrary amount of input belts should be able to go to any arbitrary amount of output belts.

Balancers often do not fulfill the second condition because of internal bottlenecks. The gif on the right shows a 4 → 4 balancer being fed by two belts, but only outputting one belt which means that its throughput in that arrangement is 50%. The bottleneck in this balancer is that the two middle belts only get input from one splitter. So, if only one side of that splitter gets input, as can be seen in the gif, it can only output one belt even though the side of the splitter is fed by a splitters which gets two full belts of input. In this particular case, the bottleneck can be fixed by feeding the two middle output belts with more splitters. This is done by adding two more splitters at the end of the balancer, as it can be seen here:

4to4 balancer.png

However most balancers' bottlenecks can't be solved as easily. A guaranteed method to achieve throughput unlimited balancers is to place two balancers back to back that fulfil the first condition for throughput unlimited balancers (100% throughput under full load). The resulting balancer is usually larger than a balancer that was initially designed to be throughput unlimited. This is the case because they use more splitters than the minimum required amount of splitters for a throughput unlimited balancer. For n → n balancers where n is a power of two numbers, n×log2(n)−n÷2 can be used to calculate how many splitters are needed. This formula is based on the number of nodes in a Beneš network, which is essentially the same as a throughput unlimited balancer — it allows any input to reach any output.

Universal balancers

Many balancers fail to balance properly once an output backs up or if an output is not used. In essence this means that an n-n balancer is not a functional n-(n-1) balancer. Sometimes this can be fixed by looping the unused output back around the balancer and distributing it among the inputs. Other times, this is not an option. Universal balancers solve this issue by having the back-looping built in. These balancers can balance evenly between any inputs and any outputs. Universal balancers can be throughput limited. If a universal balancer is throughput limited, the bottleneck may be in the loops or the balancer itself. A throughput limited universal balancer may only have the capacity for a few unused outputs. When more than the number of allowed outputs backs up, the universal balancer behaves like a normal balancer, and may not balance properly.

Lane balancers

This output balanced lane balancer distributes the items evenly among the output lanes, achieving output balance.

Lane balancers may be output balanced or input balanced. Input balanced lane balancers draw evenly from each side of the input belt, while output balanced lane balancers output evenly onto each lane of the output belt.

See also

Further reading