allow slack when goal is increasing epc

This commit is contained in:
Khalim Conn-Kowlessar 2025-07-31 19:15:19 +01:00
parent 2c19b89c77
commit e7005be801

View file

@ -877,7 +877,10 @@ async def model_engine(body: PlanTriggerRequest):
else:
if body.budget:
optimiser = GainOptimiser(input_measures, max_cost=body.budget, max_gain=gain)
optimiser = GainOptimiser(
input_measures, max_cost=body.budget, max_gain=gain,
allow_slack=body.goal == "Increasing EPC"
)
else:
# The minimum gain is the minimum number of SAP points required to get to the target SAP band
# If the gain is negative, the optimiser will return an empty solution