In the equations I wrote, 3 pumps tried to pull a combined 600×50%=300 fluid that tick, but since there was only 100 in the segment, it got split up as 33, 33, and 34. If I try to follow your instructions:
[volume]=100
[seg-cap]=200mmmPI wrote: Sun Jul 07, 2024 3:13 am (2) get segment capacity ( number of pipe * pipe capacity ) +( number of tank * tank capacity ) ....
[seg-fill]=[volume]÷[seg-cap]×100%=50% (I'm going to assume you wrote it backwards)
[entity]=[seg-fill]×100=50mmmPI wrote: Sun Jul 07, 2024 3:13 am (4) get entity from which pumps are attempting to pull volume (3) * capacity of that particular entity
[optimistic]=3×[entity]=150mmmPI wrote: Sun Jul 07, 2024 3:13 am (5) get pump max optimistic pulling rate from that entity ( number of pump attached to that single pipe * (4))
[optimistic]=150>100=[volume]mmmPI wrote: Sun Jul 07, 2024 3:13 am (6) check if all pump can pull at max rate : => compare (5) and (1)
[pull]=[volume]÷3×[seg-fill]=100÷3×50%=16.6667mmmPI wrote: Sun Jul 07, 2024 3:13 am if (5) < (1) , all pumps gets to pull (4) quantity of fluid,
if (5)> (1), all pumps gets to pull [(1)/number of pumps]*(3) quantity of fluid
[...]
???
Not only does the answer not make sense, (since the pumps should exactly drain the segment if they're trying to pull more than available,) you've introduced 3 steps (4, 5, and 6) that require querying and calculating for multiple individual entities (the pipe pieces and tanks that output machines are attached to) every tick, massively slowing down calculations if the segment has a lot of output machines, and worse, there doesn't seem to be any reference at all to the nominal flow rate of the machines involved, (12000/s or 200/tick for the pumps in this case,) so all machines would be drawing based on the same individual pipe/tank limits. (Why would a chem plant or turbine get as much as 100 or 25000 fluid per tick!?)