Mekanism

Mekanism

111M Downloads

Pressurized Tubes not splitting Gas up Evenly

mizz141 opened this issue ยท 4 comments

commented

I have an x5 Ore Prozessing going on in my Base but it was too slow with just 1 Crystalizer so i added 9 more, But the Problem now is that sometimes a crystalizer ends up with 100 MB and another with just 99 MB and so on... Can someone explain me why this happens?

commented

Because math in computers doesn't work like in real life. (9f/3f=3.0000000000000000000000001)

commented

To be pandentic, I'm reasonably certain a computer would see 9/3 = 3. I don't have a ton of experience with computer science, but 9/3 looks rather clean.

I believe the issue you are referring to is a floating point error. That Issue come up with numbers that are long (lots of digits). For instance, 1/3 = 0.3333333333... (infinitely long). A computer cuts that number off, so it sees 1/3 = 0.3333 (abnormally small number of digits in this example due to laziness). If you then use that number in another calculation, you get a rounding error. (1/3) * 3 -> 0.3333 * 3 = 0.9999.

9/3 = 3
X = 1/3 -> 0.3333
X * 9 = 2.9997

I'm not sure what would happen with 1/3 * 9 in one line. It might depend on the programming language.

commented

Eh I've seen this on a more simple basis.

Solar Neutron Activators in a chain outputting on one pipe. Pipe splits between two gas tanks. One gas tank gets about 2/3 while the other gets 1/3. That's a fairly significant spread. In my case I didn't really care as it is just bulk storage but for processing scenarios, this would be annoying.

Should they work in "round robin" mode with all outputs? I guess I never thought too much about them until I saw this issue. :)

commented

The distribution of gas actually randomly shuffles the acceptor list to determine which tanks should receive the remainder. Any difference in distribution is due to the number generator not giving equal distributions.