Inserter Throughput


Displays the throughput of the selected inserter (under ideal conditions). Now with a measuring tool for live testing.

Utilities
1 year, 3 months ago
0.18 - 1.1
19.6K
Logistics

b Rounding Errors

2 years ago

I love your mod and I am using it for a while now.
But I recently noticed that values don't seem perfectly accurate.
I modded a bit and tested. If I set data.raw["inserter"]["fast-inserter"].rotation_speed = 0.0333333
for a normal 180° move it should come up to approx. 2 per sec. But your mod shows 1.88 per sec which is significantly different.
I looked at your code and saw this: local ticks_per_cycle = 2 * round_up(angle / full_circle_in_radians / rotation_speed)
Your round up rounds 15 to 16 and there is where the discrepancy comes from.
I wonder why you round here at all, I think it would be more accurate without rounding. Can you look into this? I would appreciate it.

2 years ago

I round there because the game works discretely, tick by tick. The movement takes an integer number of ticks. Did you actually measure the inserter speed and find that it's not 1.88 or is it just contrary to your expectations?

2 years ago
(updated 2 years ago)

I tested with a recipe that takes 0.5sec and the machine has crafting speed 1 and it was able to keep up.
I will do some more tests, maybe you can do too.
I was investigating because I was seeing inaccurate numbers now several times. For example when playing Krastorio 2, the superior inserter speed was not displayed correctly.

2 years ago

Alright, I'll look into it.

2 years ago

Alright I spent a lot of time testing.
Using the furnace recipe (0.5s) with an assembler with speed 1 and a normal 180° move I tried to figure out the rotation speed which is just shy of being enough of keeping up to find out how vanilla rounds. I came up with 0.0332666 is too slow while 0.0332667 is just enough. This is exactly the fraction of 499/15000. I have no idea why vanilla rounds here. But 1/15000 seems the precision you need to calculate with. I hope that helps. Let me know if you can confirm that.

2 years ago

Yeah, sorry, I did some tests that day and found that the inserter arm angle position has a precision of 0.001 for the game to consider the arm having arrived at the destination. There were also other borderline behaviors I wasn't accounting for. I'll release the new version soon, just want to add a feature to it.

1 year, 11 months ago

It's out. Sorry it took me so long.

New response