Skip to content

Commit

Permalink
Cleaning and finalising
Browse files Browse the repository at this point in the history
  • Loading branch information
Enrico Scala committed Sep 18, 2024
1 parent c16b2c4 commit 803b404
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
20 changes: 10 additions & 10 deletions unified_planning/io/pddl_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]),
Expand All @@ -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"]
Expand All @@ -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]),
Expand All @@ -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"]
Expand Down
3 changes: 0 additions & 3 deletions unified_planning/model/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 0 additions & 4 deletions unified_planning/model/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 803b404

Please sign in to comment.