Page 1 of 1

Auto-Calculate Productivity for Selected Recipes

Posted: Wed Mar 25, 2026 5:27 am
by 2833680766
For auto change recipe, we are always looking at avoid loosing productivity.
Now I create a machine to auto calculate productivity. Automatically calculates productivity for specific recipes by monitoring item quantity changes inside the machine.

When the recipe completion signal F is output:

If the item count decreases, it indicates normal operation. This quantity is recorded as A.

If the item count increases (all items increase), it indicates a productivity bonus. This quantity is recorded as B.

By reading the item changes on the inserter, I eliminated the impact of the inserter's picking action on the contents.
But I can't remove the effect of fluid input/output on the contents, since I can't read the pump's contents or flow rate. Specifically, even when I disable the pump, the fluid already inside it keeps flowing out, which is really frustrating.

Obviously, it can not use for Metallic asteroid crushing.

I start recording from the frame where A = 1, and continue until the frame just before A = 101. In this way, the machine runs exactly 100 cycles, and the value of B is the productivity. After that, we apply the Euclidean algorithm to A and B to obtain the minimum guaranteed productivity number.

To be honest, I’m not a fan of “guaranteed productivity,” because I feel that no matter what the productivity is, can’t I just request 100 times the raw materials at once?

Re: Auto-Calculate Productivity for Selected Recipes

Posted: Wed Mar 25, 2026 5:42 am
by 2833680766
The language I use is zh-CN. When I have free time, I will upload an English version.

The core implementation of the Euclidean algorithm is two arithmetic combinators: one does A % B and outputs A, the other does B % A and outputs B.

Re: Auto-Calculate Productivity for Selected Recipes

Posted: Mon Mar 30, 2026 3:39 pm
by mmmPI
2833680766 wrote: Wed Mar 25, 2026 5:42 am When I have free time, I will upload an English version.

The core implementation of the Euclidean algorithm is two arithmetic combinators: one does A % B and outputs A, the other does B % A and outputs B.
I am curious because it look smaller (better) than my version : viewtopic.php?t=113159, but on the blueprint, i can not see the same as in the picture.

Also the blueprint look like it could be made even smaller if you used pulse mode for the inserters :
pulse.jpg
pulse.jpg (93.21 KiB) Viewed 74 times
Maybe there are some reason i don't understand why you use "Hold" and not "Pulse" ? it look like the purpose of some combinators is to create a 1 tick signal,but if you change the mode of the inserter, it can create 1 tick signal too, without extra combinators with *-1 but i can not read zh-CN, so it is a bit like magic, maybe it is already explained :(

Maybe you can use trains for fluid ? or a tank ? you cannot read pump flow easily, but you can read content of tanks or fluid wagon, if you read the quantity at when the receipe is finished.