Zistack / Satisfactory-Optimizer

A simple python script that uses scipy.optimize.linprog to calculate and optimize factory plans for Satisfactory with respect to a highly configurable set of constraints.
4 stars 0 forks source link

Round Up Count of Building to Integers #4

Open vitharr137 opened 3 weeks ago

vitharr137 commented 3 weeks ago

Hello,

Would it be possible to add a flag that would lock the building count to integers, forcing the solver to adjust the overall overclock only to reach specific fractional output/input values instead?

Zistack commented 3 weeks ago

It would not be possible to do that, unfortunately. That upgrades the problem from linear programming to integer programming, which would require something like Z3 - I've tried using Z3 for this tool in the past, but it fails the solve the problem in a reasonable amount of time when overclocking gets involved.

Overclocking is one thing - somersloops are another. The fact that the solver assumes that you can use fractional somersloops is kindof a PITA, and there isn't really anything I can do about it. It's the same problem under the hood.

For overclocking, specifically, I might be able to change how some stuff is reported, if that would help. What, specifically, do you want the solver to tell you?

vitharr137 commented 3 weeks ago

Sloops definitely seem like a lot even on the face of a problem

I think, if possible, the two most common reporting methods that would correspond to factory layouts best would be the average overclock across an integer of machines, or X count of machines at 100% overclock (or potentially a specified clock), and one more machine covering the leftover clock needed to take up the remainder (separately reported)

Thinking slightly more on it, the flag for "minimize_machine_count" could be useful to designate if overclocking is allowed, or only underclocking. true allowing ranges > 100%, false only allowing equal to or less than 100%