mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
handle all plans having zero cost 🟩
This commit is contained in:
parent
a8d3ce599d
commit
0e279b15ce
1 changed files with 9 additions and 5 deletions
|
|
@ -94,11 +94,15 @@ def choose_cheapest_relevant_plan(
|
|||
for plan in eligible_plans
|
||||
)
|
||||
|
||||
cheapest_plans: List[Plan] = [
|
||||
plan
|
||||
for plan in eligible_plans
|
||||
if (plan.record.cost_of_works or float("inf")) == min_cost
|
||||
]
|
||||
if all(p.record.cost_of_works == 0 for p in eligible_plans):
|
||||
cheapest_plans = eligible_plans
|
||||
|
||||
else:
|
||||
cheapest_plans: List[Plan] = [
|
||||
plan
|
||||
for plan in eligible_plans
|
||||
if (plan.record.cost_of_works or float("inf")) == min_cost
|
||||
]
|
||||
|
||||
for priority_scenario_id in scenario_priority_order:
|
||||
for plan in cheapest_plans:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue