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 c5b4b3f
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[Expression, 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 c5b4b3f

Please sign in to comment.