scottmsul / FactorioQualityOptimizer

Optimizes prod/quality module ratios for creating high-quality products in Factorio
MIT License
12 stars 4 forks source link

Issue with negative quality percent #7

Closed ytterbium closed 18 hours ago

ytterbium commented 1 day ago

The computation the quality probability factor in linear_solver.py is erroneous when the quality percent is negative (eg. with speed beacons). When this is the case. the script considers that there is negative probability of producing higher quality items, equivalent to e a recipe that consumes higher quality items.

This problems can be mitigated by correcting the computation of quality percent, or adding this line in line 78

    quality_percent = max(0, quality_percent)
scottmsul commented 1 day ago

Yes, good point. I'm away from my PC at the moment, could you submit a pr? If not no worries, I can get to it tonight.

scottmsul commented 18 hours ago

Fixed