Page 1 of 1
Signal Filtering
Posted: Sat Nov 09, 2024 12:04 pm
by emphes
TL;DR
Add an option to filter a list of signals to only selected signals at original signal level.
What?
I would imagine the new selector combinator would match best thematically, with an extra option in the drop-down to filter signals. This would give you a filter selection box as evidenced in many places in the game already, and then the input signals could be white/blacklisted in exactly the same way. Given there are no physical items being handled, this would be an infinity expandable list like a logistics request.
It feels like the decider combinator almost has this functionality already, where you can set a list of requirements for a signal and process it for each. However, the 'EACH' output signal type is not available when specifying input signal types.
I see no way to restrict the type of signal without using a separate combinator for each. An alternate solution to the above would be to change the 'each' process, or add an 'EACH' operation to the 'OR' and 'AND' input operators.
Why?
Specifically when using the new space platform hubs or reading a logistics network you end up with large lists of signals to process. The selector combinator already adds the ability to work more effectively with these large signal sets, but I feel like the game is missing this important function.
Re: Signal Filtering
Posted: Sat Nov 09, 2024 1:15 pm
by Tinyboss
- 11-09-2024, 07-16-07.png (184.23 KiB) Viewed 1041 times
Re: Signal Filtering
Posted: Sat Nov 09, 2024 1:23 pm
by Tinyboss
- 11-09-2024, 07-23-56.png (168.41 KiB) Viewed 1039 times
Re: Signal Filtering
Posted: Sat Nov 16, 2024 3:56 pm
by DeathJunkie88
I wanted to chime in with an additional use case, based around bridging the logistics network to the circuit network:
Multipurpose assembler for low-volume items; e.g. a single assembler to make missing logistics chests, combinators, robots, etc. Right now, I use a constant combinator to set desired items, N arithmetic combinators (item + 0) to filter, then a selector combinator to choose the item with the least supply, feeding an assembler configured for "set recipe". This ends up not really saving that much space, due to all the arithmetic combinators. With a filter option in a selector combinator, this could be reduced to just 1 constant combinator and 2 selector combinators (filter, choose input) no matter the number of items to examine.
EDIT: Actually, I was able to find a solution to this problem using only 1 constant combinator and 1 arithmetic combinator. Since you can now choose which color wire is used on each side of an arithmetic expression, and there's an "each item" meta-signal, you can implement a whitelist filter mechanism as follows:
- Connect the constant combinator output to the green input of the arithmetic combinator
- Connect the unfiltered circuit (e.g. roboport) to the red input of the arithmetic combinator
- Set the constant combinator to output the signals you want, quantity 1
- Set the arithmetic combinator to expression <R:each item> <*> <G:each item> and output <each item>
- Now, the output of the arithmetic combinator will have only the desired signals
(I see now that this is likely what is being shown in the screenshots from Tinyboss)
Re: Signal Filtering
Posted: Sat Nov 16, 2024 5:13 pm
by DeathJunkie88
I was also able to come up with some blacklist solutions. I added some hastily made whiteboard diagrams too.
First, using 3 combinators total, if you only have positive signals:
- Constant combinator (CC) with items to exclude set to -1
- Arithmetic combinator (AC) with R wire coming from input circuit (IN) and G wire coming from CC
- Set AC to expression {R:each} {*} {G:each} and output {each} (this turns the undesired input signals negative)
- Decider combinator (DC) with R wire coming from AC
- Set DC to expression {each} {>} {0} and output {each@input quantity} (this filters out the undesired input signals)
- DC output to output circuit (OUT)
And using 4 combinators total, if you have positive and negative signals to preserve:
- Constant combinator (CC) with items to exclude set to 1
- Decider combinator (DC) with R wire coming from input circuit (IN)
- Set DC to expression {each} {!=} {0} and output {each@1} (this outputs an indicator for each input signal)
- Arithmetic combinator (AC1) with R wire coming from DC and G wire coming from CC
- Set AC1 to expression {R:each} {-} {G:each} (this removes undesired signals from the indicators)
- Arithmetic combinator (AC2) with R wire coming from IN and G wire coming from AC1
- Set AC2 to expression {R:each} {*} {G:each} (this replaces desired signal indicators with their original quantities)
- AC2 output to output circuit (OUT)
Re: Signal Filtering
Posted: Thu Nov 28, 2024 3:42 pm
by Olacken
For the black list there is a simpler solution :
(In) (CC)
├──┐│
(DC)(AC)
├──┘
With the constant combinator having every item to black list set to -1,
the decider combinator being a pass through (ie: each ≠ 0 => each)
and the arithmetic combinator set to (each G * each R => each).
And it has the added benefit of synchronizing the outputs so there is no "undifined behavior" when the signal changes