Skip to main content

Online Learning of Action Models (OLAM).

Project description

Online Learning of Action Models for PDDL Planning

Refactored implementation of the Online Learning of Action Models (OLAM) algorithm, presented at IJCAI 2021 (paper).

OLAM learns PDDL action models online — interleaving planning and execution — without requiring pre-collected trajectories. Starting from a domain skeleton (predicates and operator signatures with empty preconditions and effects), it incrementally refines the action model as the agent acts in a simulated environment.

The original code used for the paper experiments is preserved at the ijcai-2021 branch.

Installation

From PyPI

pip install olam

From AMLGym

pip install amlgym

Please refer to OLAM integration in AMLGym for a usage example.

For developers

Clone the repository and install in editable mode:

git clone https://github.com/LamannaLeonardo/OLAM.git
cd OLAM
pip install -e .

Quick Start

from unified_planning.io import PDDLReader
from unified_planning.shortcuts import SequentialSimulator
from amlgym.benchmarks import get_domain_path, get_problems_path
from amlgym.util.util import empty_domain

from olam.OLAM import OLAM

# Instantiate a simulated environment from a PDDL domain and problem
domain = 'blocksworld'
domain_ref_path = get_domain_path(domain)
problem_path = get_problems_path(domain, kind='learning')[0]
problem = PDDLReader().parse_problem(domain_ref_path, problem_path)
env = SequentialSimulator(problem=problem)

# Get an input domain path with predicates and operators signature
input_domain_path = empty_domain(domain_ref_path)

# Run the OLAM algorithm
olam = OLAM(input_domain_path)
domain_learned, trajectory = olam.run(env, max_steps=100)

# Print learned domain and produced trajectory
print("##################### Learned domain #####################")
print(domain_learned)

print("################# Generated trajectory ##################")
print(trajectory)

Benchmark Results

OLAM is evaluated on 23 classical planning domains drawn from the IPC benchmark suite. Each domain is paired with a set of 10 problem instances used for incremental online learning. The following table reports for each domain the syntactic precision and recall of the learned model and CPU time (seconds) averaged over all instances.

Domain Precision Recall CPU Time (s)
Barman 0.98 1.00 385.92
Blocksworld 1.00 1.00 3.57
Depots 0.98 1.00 5.52
Driverlog 0.94 1.00 7.67
Elevators 0.89 1.00 183.89
Ferry 0.93 1.00 2.07
Floortile 0.83 1.00 5.17
Gold-Miner 0.81 1.00 15.76
Grid 0.82 1.00 5.06
Gripper 1.00 1.00 0.43
Hanoi 0.88 1.00 0.39
Matching-BW 0.99 1.00 66.49
Miconic 1.00 1.00 3.99
N-Puzzle 0.88 1.00 0.36
NoMystery 0.92 1.00 1.46
Parking 0.89 1.00 2.49
Rover 0.83 0.88 48.19
Satellite 1.00 1.00 3.57
Sokoban 0.88 1.00 20.39
Spanner 0.93 1.00 5.54
TPP 0.95 1.00 366.42
Transport 0.93 1.00 5.56
Zenotravel 1.00 1.00 6.41

Citation

If you find OLAM useful for your research, please cite the following 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},
  pages     = {4112--4118},
  year      = {2021},
  doi       = {10.24963/ijcai.2021/566},
}

License

This project is licensed under the MIT License — see the LICENSE file for details.


Acknowledgements

Refactored with the help of Ejdis Gjinika.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

olam-1.0.3.tar.gz (98.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

olam-1.0.3-cp310-cp310-macosx_11_0_arm64.whl (245.0 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file olam-1.0.3.tar.gz.

File metadata

  • Download URL: olam-1.0.3.tar.gz
  • Upload date:
  • Size: 98.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.13

File hashes

Hashes for olam-1.0.3.tar.gz
Algorithm Hash digest
SHA256 74dfb2dd7c28597e99b63980f980ddf1ef3fdebb305bcacce1a28ea1b5b7d956
MD5 5f870218df88b52e0870c30024a2c518
BLAKE2b-256 2565910f4eb5e962556de21bde5097b722db8002cd1e587fd8e50550fd812e0c

See more details on using hashes here.

File details

Details for the file olam-1.0.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for olam-1.0.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a22725f01ccee9cfe4607a199e22d40301c6bb6f4a1f0cba6f3363afff2873b1
MD5 19c2db266bdd189e5a443e13fe2d48f2
BLAKE2b-256 05d4fbdcc5d6c7c3b20ef5f37a7511d260ec2e4eddfa4ac259fe6fd34d920b7d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page