scottmsul / FactorioQualityOptimizer

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

Error in machine speed computation #6

Closed ytterbium closed 1 day ago

ytterbium commented 3 days ago

The computation of the machine speed in linear_solver.py is wrong. Currently, the code considers that the speed bonus of modules and of the machine quality are additive. Instead, in-game they are multiplicative.

The line 319 of linear_solver.py should be corrected as :

            speed_factor = crafting_machine_speed * (1 + self.building_speed_bonus) * (1 +\
                    + (num_effective_speed_modules * self.speed_module_bonus) \
                    - (num_qual_modules * self.speed_penalty_per_quality_module) \
                    - (num_prod_modules * self.speed_penalty_per_prod_module) \
            )
scottmsul commented 3 days ago

Thanks for bringing this to my attention! This has been fixed.