From e7005be80140c100544e21cff3a9f3b12132e4a9 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 31 Jul 2025 19:15:19 +0100 Subject: [PATCH] allow slack when goal is increasing epc --- backend/engine/engine.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/engine/engine.py b/backend/engine/engine.py index 04860add..db3b6d0d 100644 --- a/backend/engine/engine.py +++ b/backend/engine/engine.py @@ -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