From a73c616f7cdd3a28124fc4babc62271acc8c1a72 Mon Sep 17 00:00:00 2001 From: Luca Framba Date: Wed, 25 Oct 2023 14:25:18 +0200 Subject: [PATCH] Added optimum to tests in UP that have quality metrics --- unified_planning/test/examples/minimals.py | 6 ++++-- unified_planning/test/examples/testing_variants.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/unified_planning/test/examples/minimals.py b/unified_planning/test/examples/minimals.py index d16a7ad99..8e033a26c 100644 --- a/unified_planning/test/examples/minimals.py +++ b/unified_planning/test/examples/minimals.py @@ -71,7 +71,7 @@ def get_example_problems(): problem.add_quality_metric(qm) plan = up.plans.SequentialPlan([up.plans.ActionInstance(a)]) basic_oversubscription = TestCase( - problem=problem, solvable=True, valid_plans=[plan] + problem=problem, solvable=True, valid_plans=[plan], optimum=10 ) problems["basic_oversubscription"] = basic_oversubscription @@ -321,7 +321,9 @@ def get_example_problems(): plan = up.plans.SequentialPlan( [up.plans.ActionInstance(act_b), up.plans.ActionInstance(act_c)] ) - basic_with_costs = TestCase(problem=problem, solvable=True, valid_plans=[plan]) + basic_with_costs = TestCase( + problem=problem, solvable=True, valid_plans=[plan], optimum=2 + ) problems["basic_with_costs"] = basic_with_costs # counter diff --git a/unified_planning/test/examples/testing_variants.py b/unified_planning/test/examples/testing_variants.py index e10b13f00..8c3b357bf 100644 --- a/unified_planning/test/examples/testing_variants.py +++ b/unified_planning/test/examples/testing_variants.py @@ -821,7 +821,7 @@ def get_example_problems(): ] ) locations_connected_visited_oversubscription = TestCase( - problem=problem, solvable=True, valid_plans=[plan] + problem=problem, solvable=True, valid_plans=[plan], optimum=15 ) problems[ "locations_connected_visited_oversubscription" @@ -893,7 +893,7 @@ def get_example_problems(): ] ) locations_connected_cost_minimize = TestCase( - problem=problem, solvable=True, valid_plans=[plan] + problem=problem, solvable=True, valid_plans=[plan], optimum=10 ) problems["locations_connected_cost_minimize"] = locations_connected_cost_minimize