diff --git a/unified_planning/io/pddl_reader.py b/unified_planning/io/pddl_reader.py index b0ef9b095..62ef08aa2 100644 --- a/unified_planning/io/pddl_reader.py +++ b/unified_planning/io/pddl_reader.py @@ -1264,12 +1264,12 @@ def declare_type( ) for p in g.value[0]: a_params[p] = t - act = up.model.Process(n, a_params, self._env) + proc = up.model.Process(n, a_params, self._env) if "pre" in a: - act.add_precondition( + proc.add_precondition( self._parse_exp( problem, - act, + proc, types_map, {}, CustomParseResults(a["pre"][0]), @@ -1279,12 +1279,12 @@ def declare_type( if "eff" in a: self._add_effect( problem, - act, + proc, types_map, CustomParseResults(a["eff"][0]), domain_str, ) - problem.add_action(act) + problem.add_action(proc) for a in domain_res.get("events", []): n = a["name"] @@ -1305,12 +1305,12 @@ def declare_type( ) for p in g.value[0]: a_params[p] = t - act = up.model.Event(n, a_params, self._env) + evt = up.model.Event(n, a_params, self._env) if "pre" in a: - act.add_precondition( + evt.add_precondition( self._parse_exp( problem, - act, + evt, types_map, {}, CustomParseResults(a["pre"][0]), @@ -1320,12 +1320,12 @@ def declare_type( if "eff" in a: self._add_effect( problem, - act, + evt, types_map, CustomParseResults(a["eff"][0]), domain_str, ) - problem.add_action(act) + problem.add_action(evt) for a in domain_res.get("actions", []): n = a["name"] diff --git a/unified_planning/model/action.py b/unified_planning/model/action.py index ac9aa2a06..0d76fbaf7 100644 --- a/unified_planning/model/action.py +++ b/unified_planning/model/action.py @@ -956,9 +956,6 @@ def add_derivative( ) ) - def __repr__(self) -> str: - action_str = InstantaneousAction.__repr__(self) - return action_str.replace("action", "process") class Event(InstantaneousAction): diff --git a/unified_planning/model/problem.py b/unified_planning/model/problem.py index f858152e1..b174ee32f 100644 --- a/unified_planning/model/problem.py +++ b/unified_planning/model/problem.py @@ -116,10 +116,6 @@ def __repr__(self) -> str: s.append("]\n\n") s.append("actions = [\n") s.extend(map(custom_str, self.actions)) - s.append("processes = [\n") - s.extend(map(custom_str, self.processes)) - s.append("events = [\n") - s.extend(map(custom_str, self.events)) s.append("]\n\n") if len(self.user_types) > 0: s.append("objects = [\n")