Skip to content

Commit

Permalink
fix(interpreted functions): removed bad anytime test
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Gobbi committed Sep 27, 2024
1 parent 6aadee4 commit 7846550
Showing 1 changed file with 0 additions and 46 deletions.
46 changes: 0 additions & 46 deletions unified_planning/test/test_anytime.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,49 +81,3 @@ def test_counters_modified(self):
len(solutions[0].plan.actions), len(solutions[1].plan.actions)
)
# this will most likely error if you somehow got here

@skipIfNoAnytimePlannerForProblemKind(
simple_numeric_kind.union(quality_metrics_kind),
up.engines.AnytimeGuarantee.INCREASING_QUALITY,
)
def test_counters_small(self):
reader = PDDLReader()
domain_filename = os.path.join(PDDL_DOMAINS_PATH, "counters", "domain.pddl")
problem_filename = os.path.join(PDDL_DOMAINS_PATH, "counters", "problem.pddl")
# using the modified problem3 to save time
problem = reader.parse_problem(domain_filename, problem_filename)
problem.add_quality_metric(MinimizeSequentialPlanLength())

with AnytimePlanner(
problem_kind=problem.kind, anytime_guarantee="INCREASING_QUALITY"
) as planner:
self.assertTrue(planner.is_anytime_planner())
solutions = []
for p in planner.get_solutions(problem):
self.assertTrue(p.plan is not None)
solutions.append(p)
if len(solutions) == 2:
break

self.assertEqual(len(solutions), 2)
if solutions[1].status == PlanGenerationResultStatus.INTERMEDIATE:
self.assertGreater(
len(solutions[0].plan.actions), len(solutions[1].plan.actions)
)
elif solutions[1].status == PlanGenerationResultStatus.SOLVED_SATISFICING:
self.assertEqual(
len(solutions[0].plan.actions), len(solutions[1].plan.actions)
)
elif solutions[1].status == PlanGenerationResultStatus.INTERNAL_ERROR:
print("this sometimes happens with large problems")
print(solutions)
self.assertGreater(
len(solutions[0].plan.actions), len(solutions[1].plan.actions)
)
# this will most likely error if you somehow got here
else:
print(solutions)
self.assertGreater(
len(solutions[0].plan.actions), len(solutions[1].plan.actions)
)
# this will most likely error if you somehow got here

0 comments on commit 7846550

Please sign in to comment.