Skip to content

Commit

Permalink
Fixed bug in SimulatedEnvironment
Browse files Browse the repository at this point in the history
  • Loading branch information
alvalentini committed Apr 24, 2023
1 parent 468026b commit 0a6fe44
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion unified_planning/model/contingent/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0a6fe44

Please sign in to comment.