ronuchit / pddlgym_planners

PDDL planner interface for PDDLGym.
MIT License
27 stars 15 forks source link

installation path of planner in Linux #6

Closed quimortiz closed 2 years ago

quimortiz commented 2 years ago

Hi!

The following modification was necessary to install the ff planner in linux (otherwise, the code is unpacked in the current working directory, and not in pddlgym_planners)

diff --git a/ff.py b/ff.py
index 1ef5b65..714c19e 100644
--- a/ff.py
+++ b/ff.py
@@ -79,7 +79,8 @@ class FF(PDDLPlanner):
         else:
             # Install FF directly from official website.
             os.system("curl {} --output {}.tgz".format(FF_URL, loc))
-            os.system("tar -xzvf {}.tgz".format(loc))
+            dirname = os.path.dirname(os.path.realpath(__file__))
+            os.system("cd {} && tar -xzvf {}.tgz".format(dirname,loc))
         # Compile FF.
         os.system("cd {} && make && cd -".format(loc))
         assert os.path.exists(self._exec)

I run the code of the readme with python3 main2.py with the following directory structure:

.
├── frame1.png
├── frame2.png
├── main2.py
├── main.py
└── pddlgym_planners
    ├── FD
    ├── fd.py
    ├── ff.py
    ├── FF-v2.3
    ├── FF-v2.3.tgz
    ├── LICENSE.md
    ├── main2.py
    ├── pddl_planner.py
    ├── planner.py
    ├── __pycache__
    ├── README.md
    ├── setup.py
    └── test.py

Thanks for the repo!

tomsilver commented 2 years ago

Thanks so much for reporting the bug! I reproduced the bug and implemented a fix based on your suggestion (#7 ) We'll get that merged shortly.