A little while back there a Comment asked for the implementation of Min/Max as operators in something like the Arithmetic Combinator. This link viewtopic.php?f=236&t=109636
This was closed as already implemented by the selector combinator in 2.0. Which I don't think is an accurate statement. The argument is that the selector combinator sorts a list of input signals and can return the largest/smallest signal. The problem is that in factorio, signals with zero value are not signals. So the selector combinator's sort will sort the list with the zero signal missing and thus will return the constant value when the input is zero. So, using it as a min/max operator only works if you don't have input values in the zero range.
In my opinion, the selector combinator is not a replacemeant for a min/max operator. Because if you want a number say between the values of 0 and 3(what you want on a train stop) you have to bend over backwards to make it work. By offsetting the values away from zero or something like that. This would likely be 2 Arithmetic operators, a selector, and a constant combinator.
In practice, everyone is likely going to stick with what they do today and use 2 decider combinators and multiply and a bunch of ugly constant management. So, I would like to suggest again that the arithmetic combinator have a min/max and possible clamp operator. It's simple and easy to understand and fits very well in the existing functionality of the Arithmetic Combinator.
The Arithmetic Combinator Min/Max I admit still has some issues around inputs of zero while using the undefined input signal option, but those issues are the same for any Arithmetic Combinator operator.
Selector Combinator is not Min/Max
Moderator: ickputzdirwech
-
- Burner Inserter
- Posts: 10
- Joined: Fri Nov 10, 2023 7:28 pm
- Contact:
-
- Filter Inserter
- Posts: 544
- Joined: Mon Feb 05, 2018 10:01 am
- Contact:
Re: Selector Combinator is not Min/Max
Also, min/max of the same signal but comparing red vs green wires.
Re: Selector Combinator is not Min/Max
Just to restate your argument:
While the Selector allows indexing into a ordered list of non-zero signals, what's still missing is a min/max of two specific signals. Where min(0,x) for x > 0, and max(0,x) for x < 0 would return 0.
I agree that's missing, and would certainly be nice (although you can already do that with two deciders). I'm not sure we'd also need a clamping operation - having min/max would already reduce that from 3 combinators to 2.
However, I, as many on the FFF thread, agree that having input wire selection on the Arithmetic as well would be awesome.
While the Selector allows indexing into a ordered list of non-zero signals, what's still missing is a min/max of two specific signals. Where min(0,x) for x > 0, and max(0,x) for x < 0 would return 0.
I agree that's missing, and would certainly be nice (although you can already do that with two deciders). I'm not sure we'd also need a clamping operation - having min/max would already reduce that from 3 combinators to 2.
However, I, as many on the FFF thread, agree that having input wire selection on the Arithmetic as well would be awesome.