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
Owner:
Cobaltur
Source:
N/A
Homepage:
N/A
License:
MIT
Created:
7 years ago
Latest Version:
1.1.4 (1 year, 7 months ago)
Factorio version:
0.14 - 1.1
Downloaded by:
1.33K users

The mod adds a new combinator for * math instructions e.g. maximum, minimum, random and * signal sets operations e.g. difference & intersection.

Types:

  • Math.max - returns the first signal with the highest count.
  • Math.min - returns the first signal with the lowest count.
  • Math.rand - returns randomly one of the signals
  • 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
  • Set.difference : symetric difference, signals which are in red AND green will be filtered
  • Set.intersection: result set contain signals which are on red AND green circuit - values are added.
  • Set.filter: filter the red circuit with the green circuit as reference. Only the values of red circuit will be written. E.g. Program loaders for a dynamic list of signals like in Space Exploration

Notes:
For math operation red circuit is preferred. Green is only used if red is not connected to the pole.
Keep in mind signals with value=0 are not on the circuit - therefore not part of the array - so average and median may have not the expected results.
If you need all signals on a tie. Use the value within a combinator and its EACH function

Interval:

By default every 60 ticks (once per second). Can be changed in mod settings. Maybe updating the "Random" operation might be splitted in the future. But at the moment most people don't need a short latency by default.

Placement:

It's recommend to place the combinator next to electric poles.
It must be really close and the direction is important. Antenna away from the pole.

For history reason the placement adjacent to decider- or arithmetic combinator is alos supported. But the setup has its traps. So these vanilla combinators do not output values until the are connected to something else. So the Math Combinator would not get any input.

blueprint sample for 0.17.7 (retested in 1.1.0)

0eNrVWG2OmzAQvYt/QxUDIYEb7K89QLVCBpzsSGAjY6KNVhygt+jZepLaTprQBG/MhvTjTxTAHs9743l+8I7yqqONACZR+o6g4KxF6dd31MKWkUrfk/uGohSBpDXyECO1vqqJfPVJVT2xZ0ZR7yFgJX1DKe69m3PbLm8lkcDZYGLQv3iIMgkS6CEDc7HPWFfnVKjIY/M91PAWzF+1mg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