In other languages: Čeština Deutsch Français 日本語 Polski Русский Українська 简体中文

Decider combinator: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
No edit summary
 
(53 intermediate revisions by 24 users not shown)
Line 1: Line 1:
{{Languages}}
{{Languages}}
{{Logic
{{:Infobox:Decider combinator}}
|Image
 
|health=50
The '''Decider combinator''' is part of the circuit network and one of four types of combinators available in the game (with the other three being the [[constant combinator]], [[arithmetic combinator]], and [[selector combinator]]). It is used to make comparisons of signals on the network. Signals can be compared using the following:
|energy=2 kw electric
 
|cps=60
[[File:decider_combinator_anim.png]]
|input=Time, 0.5 + Copper cable, 5 + Electronic Circuit, 5
|raw=Time, 8 + Iron Plate, 5 + Copper Plate, 10
|technologies=Circuit network
|producers=Manual + Assembling machine 1 + Assembling machine 2 + Assembling machine 3
}}


[[File:DeciderSprite.png]]
*"is greater than" (<span style="color:#00FF00">></span>)
*"is less than" (<span style="color:#00FF00"><</span>)
*"greater than or equal to" (<span style="color:#00FF00">>=</span>)
*"less than or equal to" (<span style="color:#00FF00"><=</span>)
*"is equal to" (<span style="color:#00FF00">=</span>)
*"is not equal to" (<span style="color:#00FF00">!=</span>)


== Description ==
As shown in the picture below showing the GUI, the signal on the left is being compared to that of the right.


The decider combinator is part of the [[Circuit Network]] and one of three types of combinators available in the game. It is used to make comparisons of signals on the network. Signals can be compared using "is greater than" (>), "is less than" (<) or "is equal to" (=).
[[File:decider_combinator_gui.png|350px|GUI of the decider combinator.]]


== Function ==
== Function ==
==Function==
The internal logic process has three steps:
The internal logic process has three steps:


1) All input signals on the red and green wires are summed within the combinator.
# Values for each individual input signal(s) (items of the same name) on the red and green wires are summed within the combinator.
# The decider combinator GUI specifies a "first" input signal, a comparison (>, <, =, >=, <=, !=), and a "second" input signal or constant.
# If the comparison returns true, the output is one or more signals with a value of 1 or the unchanged input value(s), or a single signal carrying either a sum of input signals or the number of passed tests. ([[#output_table|see table below]])
 
The decider combinator can handle [[Circuit network#Logic signals|logic signals]].
 
Further notes:
 
* Using the Everything output with "Input count" will pass all non-zero input values to the output as long as the condition is true. Using the Everything output with "1" will output 1 ONLY for all non-zero inputs.
* The Each input will re-apply the comparison for each input signal individually, and will pass the selected output for each input that passes the conditional.
* The Everything input functions as a logical AND, and will return true only if ALL non-zero inputs pass the conditional, and returns true if there are no inputs at all (so "everything ≠ 0" always passes).
* The Anything input functions as a logical OR, and will return true if ANY non-zero input passes the conditional, and returns false if there are no inputs at all (so "anything = 0" always fails). If used for output, Anything will return one of the signals that matched.
* When "Input Count" is selected the output will match the input for the selected signal if the first parameter is not Each. If the first parameter is Each then "Input Count" refers to the value of the input signal that is currently being iterated, so the result will be the sum of all inputs if the output signal is not Each. If the output signal is also Each then every input signal that passes the test is simply forwarded while those that fail the test are discarded.
 
<span id="output table"></span>The following table shows how different combinations of the first input parameter and the output can be used.


2) The specified comparison (>, <, =) is performed on the selected signal(s).
{| class="wikitable" style="text-align: center"
|+Different output results when the test passes
|-
! align=right | Input&nbsp;→ !! rowspan=2 | <span style="color:#FFFF99">Each</span> !! rowspan=2 | <span style="color:#99FF99">Anything</span>, <span style="color:#FF6666">Everything</span>, or a specific signal
|-
! align=left | ↓&nbsp;Output
|-
!style="text-align: left"| <span style="color:#FF6666">Everything</span>: 1
|rowspan="2"| - || every input signal is forwarded but set to 1
|-
!style="text-align: left"| <span style="color:#FF6666">Everything</span>: Input count
| every input signal is forwarded
|-
!style="text-align: left"| Specific signal: 1
| number of input signals<sup>†</sup> || the specific signal with value 1
|-
!style="text-align: left"| Specific signal: Input count
| sum of inputs<sup>†</sup> || the specific signal is forwarded
|-
!style="text-align: left"| <span style="color:#FFFF99">Each</span>: 1
| each input signal<sup>†</sup> is forwarded but set to 1 ||rowspan="2"| -
|-
!style="text-align: left"| <span style="color:#FFFF99">Each</span>: Input count
| each input signal<sup>†</sup> is forwarded
|-
!style="text-align: left"| <span style="color:#99FF99">Anything</span>: 1
|rowspan="2"| - || one input signal<sup>†</sup> is forwarded but set to 1
|-
!style="text-align: left"| <span style="color:#99FF99">Anything</span>: Input count
| one input signal<sup>†</sup> is forwarded
|-
|}


3) If the comparison returns true, the selected output signal is send to the output nodes.
† signals that passed the test only


With both the arithmetic and decider combinator, there is one tick (60th of a second) of latency before the output signal is ready to be used as an input into a circuit network.
== History ==
{{history|2.0.7|
* Received a UI overhaul.
** Now displays input signals when configuring combinators.
** Signals used by combinators can now be filtered between red, green, or both.
** Multiple and/or operations can be preformed in a single decider combinator.
}}
{{history|1.1.13|
* Decider combinator can output an Anything signal, which returns exactly one matching signal.}}
{{history|0.15.0|
* Added additional operators to the Decider Combinator and Circuit Conditions.}}
{{history|0.13.0|
* Connected wires are highlighted when hovering over a combinator connected to the [[circuit network]].
* Combinators show input and output in alt mode.
* More virtual signals for combinators.
* Constant combinator can be rotated.
* Decider combinator "input count" option makes the combinator copy the count of the specified output signal from the input signals, instead of copying the count from the condition.
* New combinator graphics. }}
{{history|0.12.5|
* Combinators now emit light.}}
{{history|0.12.2|
* Combinators no longer turn off when no wires are connected.}}
{{history|0.12.0|
* Introduced}}


== See Also ==
== See Also ==
*[[Arithmetic combinator]]
* [[Arithmetic combinator]]
*[[Constant Combinator]]
* [[Constant combinator]]
*[[Circuit network]]
* [[Selector combinator]]
* [[Tutorial:Combinator tutorial|Combinator tutorial]] (description of combinator logic gates)
* [[Circuit network]]
* [[Tutorial:Circuit network cookbook|Circuit network cookbook]]
 
{{LogisticsNav}}
{{C|Circuit network}}

Latest revision as of 18:21, 2 November 2024

Decider combinator.png
Decider combinator

DeciderSprite.png

Recipe

Time.png
0.5
+
Copper cable.png
5
+
Electronic circuit.png
5
Decider combinator.png
1

Total raw

Time.png
8
+
Copper plate.png
10
+
Iron plate.png
5

Map color

Health

Quality normal.png 150
Quality uncommon.png 195 Quality rare.png 240
Quality epic.png 285 Quality legendary.png 375

Stack size

50

Rocket capacity

50 (1 stack)

Energy consumption

1 kw (electric)

Mining time

0.1

Prototype type

decider-combinator

Internal name

decider-combinator

Required technologies

Circuit network (research).png

Produced by

Assembling machine 1.png
Assembling machine 2.png
Assembling machine 3.png
Player.png

Consumed by

Selector combinator.png

The Decider combinator is part of the circuit network and one of four types of combinators available in the game (with the other three being the constant combinator, arithmetic combinator, and selector combinator). It is used to make comparisons of signals on the network. Signals can be compared using the following:

Decider combinator anim.png

  • "is greater than" (>)
  • "is less than" (<)
  • "greater than or equal to" (>=)
  • "less than or equal to" (<=)
  • "is equal to" (=)
  • "is not equal to" (!=)

As shown in the picture below showing the GUI, the signal on the left is being compared to that of the right.

GUI of the decider combinator.

Function

The internal logic process has three steps:

  1. Values for each individual input signal(s) (items of the same name) on the red and green wires are summed within the combinator.
  2. The decider combinator GUI specifies a "first" input signal, a comparison (>, <, =, >=, <=, !=), and a "second" input signal or constant.
  3. If the comparison returns true, the output is one or more signals with a value of 1 or the unchanged input value(s), or a single signal carrying either a sum of input signals or the number of passed tests. (see table below)

The decider combinator can handle logic signals.

Further notes:

  • Using the Everything output with "Input count" will pass all non-zero input values to the output as long as the condition is true. Using the Everything output with "1" will output 1 ONLY for all non-zero inputs.
  • The Each input will re-apply the comparison for each input signal individually, and will pass the selected output for each input that passes the conditional.
  • The Everything input functions as a logical AND, and will return true only if ALL non-zero inputs pass the conditional, and returns true if there are no inputs at all (so "everything ≠ 0" always passes).
  • The Anything input functions as a logical OR, and will return true if ANY non-zero input passes the conditional, and returns false if there are no inputs at all (so "anything = 0" always fails). If used for output, Anything will return one of the signals that matched.
  • When "Input Count" is selected the output will match the input for the selected signal if the first parameter is not Each. If the first parameter is Each then "Input Count" refers to the value of the input signal that is currently being iterated, so the result will be the sum of all inputs if the output signal is not Each. If the output signal is also Each then every input signal that passes the test is simply forwarded while those that fail the test are discarded.

The following table shows how different combinations of the first input parameter and the output can be used.

Different output results when the test passes
Input → Each  Anything, Everything, or a specific signal
↓ Output
Everything: 1 - every input signal is forwarded but set to 1
Everything: Input count every input signal is forwarded
Specific signal: 1 number of input signals the specific signal with value 1
Specific signal: Input count sum of inputs the specific signal is forwarded
Each: 1 each input signal is forwarded but set to 1 -
Each: Input count each input signal is forwarded
Anything: 1 - one input signal is forwarded but set to 1
Anything: Input count one input signal is forwarded

† signals that passed the test only

With both the arithmetic and decider combinator, there is one tick (60th of a second) of latency before the output signal is ready to be used as an input into a circuit network.

History

  • 2.0.7:
    • Received a UI overhaul.
      • Now displays input signals when configuring combinators.
      • Signals used by combinators can now be filtered between red, green, or both.
      • Multiple and/or operations can be preformed in a single decider combinator.
  • 1.1.13:
    • Decider combinator can output an Anything signal, which returns exactly one matching signal.
  • 0.15.0:
    • Added additional operators to the Decider Combinator and Circuit Conditions.
  • 0.13.0:
    • Connected wires are highlighted when hovering over a combinator connected to the circuit network.
    • Combinators show input and output in alt mode.
    • More virtual signals for combinators.
    • Constant combinator can be rotated.
    • Decider combinator "input count" option makes the combinator copy the count of the specified output signal from the input signals, instead of copying the count from the condition.
    • New combinator graphics.
  • 0.12.5:
    • Combinators now emit light.
  • 0.12.2:
    • Combinators no longer turn off when no wires are connected.

See Also