This repository contains the official code of the OLAM algorithm presented at IJCAI 2021, for details about the method please see the paper.
The following instructions have been tested on Ubuntu 20.04.
- Create a Python 3.9 virtual environment using conda or pip.
conda create -n olam python=3.9
- Activate the environment and install dependencies
conda activate olam
pip install numpy pandas scipy matplotlib xlwt xlrd
-
Install Oracle Java SE Development Kit (jdk), this should be a private installation that does not interfere with already existing ones. For downloading the jdk archive you can refer to this link. After downloading the jdk, move it into the "Java" folder and extract the archive by executing the command
tar -xzvf jdk-XX_linux-x64_bin.tar.gz
where XX is the jdk version you downloaded. For example, download the archive jdk-17_linux-x64_bin.tar.gz, move it into the "Java" folder, extract the archive withtar -xzvf jdk-17_linux-x64_bin.tar.gz
and then delete the unnecessary file withrm jdk-17_linux-x64_bin.tar.gz
. -
Following instructions provided in the offical FastDownward site, download FastDownard in a directory called "FD", move the directory "FD" into the "Planners" directory, go into the subdirectory "Planners/FD" and compile FastDownward through the command
./build.py
. -
From the offical FastForward site, download FF-v2.3.tgz (you can directly download it from this link), move it into the "Planners/FF" directory, extract the archive
tar -xf FF-v2.3.tgz
, go into the installation directory withcd FF-v2.3
and compile FastForward withmake
. Finally move the "ff" executable in the parent directory through the commandmv ff ../
, go to the parent directorycd ../
and delete unnecessary files withrm -r FF-v2.3
andrm FF-v2.3.tgz
. -
Verify everything is working properly by executing
python main.py -d blocksworld
(the execution may take few minutes).
By default, the OLAM algorithm is run over all instances of all domains in the "Analysis/Benchmarks" directory. If you want to run OLAM on a single domain use the -d
or --domain
argument. For example, to run OLAM on the blocksworld domain execute python main.py -d blocksworld
.
To change the problem instances, add/remove pddl files contained into the domain directory. For instance, to run OLAM only on the problem instance "1_p00_blocksworld_gen.pddl" of the blocksworld domain, remove all problems but "1_p00_blocksworld_gen.pddl" in the directory "Analysis/Benchmarks/blocksworld". Similarly you can add new problem instances.
To add a new classical planning domain "mydomain", add the pddl domain file "mydomain.pddl" into the "Analysis/Benchmarks" directory, then create the subdirectory "Analysis/Benchmarks/mydomain" with the problem instances. Finally execute the command python main.py -d mydomain
.
When you run OLAM, a new directory (e.g. "run_0") with all logs and results is created in the "Analysis" folder. The created directory contains three directories:
- Tests: contains one directory for each considered domain, e.g. "Analysis/run_0/Tests/blocksworld", which contains one directory for each problem instance. The action model learned after the resolution of the problem is called "domain_learned_certain.pddl", while "domain_learned.pddl" is the action model including also the uncertain negative effects (see the paper for further details)
- Results_cert: contains one excel file for each domain with the metrics reported in the paper, the evaluation consider the model without uncertain negative effects (i.e. "domain_learned_certain.pddl")
- Results_uncert_neg: contains one excel file for each domain with the metrics reported in the paper, the evaluation consider the model with uncertain negative effects (i.e. "domain_learned.pddl")
If you find OLAM useful, please cite this paper:
@inproceedings{ijcai2021-566,
title = {Online Learning of Action Models for PDDL Planning},
author = {Lamanna, Leonardo and Saetti, Alessandro and Serafini, Luciano and Gerevini, Alfonso and Traverso, Paolo},
booktitle = {Proceedings of the Thirtieth International Joint Conference on
Artificial Intelligence, {IJCAI-21}},
publisher = {International Joint Conferences on Artificial Intelligence Organization},
editor = {Zhi-Hua Zhou},
pages = {4112--4118},
year = {2021},
month = {8},
note = {Main Track}
doi = {10.24963/ijcai.2021/566},
url = {https://doi.org/10.24963/ijcai.2021/566},
}
This project is licensed under the MIT License - see the LICENSE file for details.