Skip to content

Commit

Permalink
fix(interpreted functions): functions in durations should now work
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Gobbi committed Sep 16, 2024
1 parent aad6735 commit 7520f30
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions unified_planning/model/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ def update_action_parameter(self, param: "up.model.Parameter"):

def update_action_duration(self, duration: "up.model.DurationInterval"):
lower, upper = duration.lower, duration.upper

for dur_bound in (lower, upper):
if dur_bound.type.is_int_type():
self.kind.set_expression_duration("INT_TYPE_DURATIONS")
Expand All @@ -947,6 +948,9 @@ def update_action_duration(self, duration: "up.model.DurationInterval"):
free_vars = self.environment.free_vars_extractor.get(
lower
) | self.environment.free_vars_extractor.get(upper)
ops = self.operators_extractor.get(lower) | self.operators_extractor.get(upper)
if OperatorKind.INTERPRETED_FUNCTION_EXP in ops:
self.kind.set_expression_duration("INTERPRETED_FUNCTIONS_IN_DURATIONS")

Check warning on line 953 in unified_planning/model/problem.py

View check run for this annotation

Codecov / codecov/patch

unified_planning/model/problem.py#L953

Added line #L953 was not covered by tests

if len(free_vars) > 0:
only_static = True
Expand Down

0 comments on commit 7520f30

Please sign in to comment.