Math Combinator


A new combinator for math instructions like maximum, minimum, random, median and set theory like intersection and difference.

Utilities
1 year, 7 months ago
0.14 - 1.1
1.33K

i Median

4 years ago

Can you add a Median function/Signal?
Like input Each and output Median. Even Mean would be better than nothing.

Why?
It is not always possible to know the exact number of Signals to use as a divisor. Especially if the Signal can be 0.

4 years ago

I added 4 new
Math.median - return the median value on virtual signal M
Math.average - return the average value on virtual signal A
Math.count - return the number of signals on virtual signal N
Math.sum - return the sum of all signal values on virtual signal S

But I cannot handle signals.value=0 because factorio is not just hinding them in the UI they are not on the circuit. So average and median can be not as expected.

As a workaround you can just use vanilla constant combinator with expected signals e.g. iron=1 etc. on the input circuit and these will be added. Just test it using 2 constant combinator with each iron=1 and connect them to a pole and see the "sum" at the pole.

Sorry not having zero value signals can be annoying but it's desinged by the developers

New response