diff --git a/unified_planning/model/contingent/environment.py b/unified_planning/model/contingent/environment.py index 93ce252fe..bc0454910 100644 --- a/unified_planning/model/contingent/environment.py +++ b/unified_planning/model/contingent/environment.py @@ -123,9 +123,13 @@ def apply( raise UPUsageError("The given action is not applicable!") self._state = new_state res = {} + subs: Dict["up.model.Expression", "up.model.Expression"] = dict( + zip(action.action.parameters, action.actual_parameters) + ) if isinstance(action.action, up.model.contingent.sensing_action.SensingAction): for f in action.action.observed_fluents: - res[f] = self._state.get_value(f) + f_exp = f.substitute(subs) + res[f_exp] = self._state.get_value(f_exp) return res def is_goal_reached(self) -> bool: