Skip to content

Commit

Permalink
Updated code according to changes in the MAPDDLWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
alvalentini committed Nov 15, 2023
1 parent 7519363 commit f9704c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def run(self):

setup(
name="up_fmap",
version="0.0.11",
version="0.0.12",
description="up_fmap",
author="Alejandro Torreño, Eva Onaindia and Oscar Sapena",
author_email="[email protected]",
Expand Down
12 changes: 5 additions & 7 deletions up_fmap/fmap_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,15 @@ def _get_cmd_ma(
"-jar",
pkg_resources.resource_filename("up_fmap", "FMAP/FMAP.jar"),
]
directory = "ma_pddl_"
for ag in problem.agents:
base_command.extend(
[
f"{ag.name}_type",
f"{directory}{domain_filename}{ag.name}_domain.pddl",
os.path.join(domain_filename, f"{ag.name}_domain.pddl"),
]
)
base_command.extend(
[f"{directory}{problem_filename}{ag.name}_problem.pddl"]
[os.path.join(problem_filename, f"{ag.name}_problem.pddl")]
)
return self._manage_parameters(base_command)

Expand Down Expand Up @@ -130,10 +129,9 @@ def _solve(
logs: List["up.engines.results.LogMessage"] = []
with tempfile.TemporaryDirectory() as tempdir:
w = MAPDDLWriter(problem, explicit_false_initial_states=True)
domain_filename = os.path.join(tempdir, "domain_pddl/")
problem_filename = os.path.join(tempdir, "problem_pddl/")
domain_filename = os.path.join(tempdir, "domain_pddl")
problem_filename = os.path.join(tempdir, "problem_pddl")
plan_filename = os.path.join(tempdir, "plan.txt")
plan_filename = "ma_pddl_" + plan_filename
w.write_ma_domain(domain_filename)
w.write_ma_problem(problem_filename)
cmd = self._get_cmd_ma(problem, domain_filename, problem_filename)
Expand Down Expand Up @@ -209,7 +207,7 @@ def _solve(
process.wait()
return PlanGenerationResult(
PlanGenerationResultStatus.TIMEOUT,
plan=plan,
plan=None,
metrics={"engine_internal_time": str(solving_time)},
log_messages=logs,
engine_name=self.name,
Expand Down

0 comments on commit f9704c5

Please sign in to comment.