Skip to main content

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.

Metadata

Release files for olam 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for olam 1.0.4
File Size Uploaded Provenance Actions
olam-1.0.4.tar.gz 100.4 kB Without provenance Details for olam-1.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for olam 1.0.4
File Interpreter ABI Platform Actions
olam-1.0.4-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for olam-1.0.4-cp310-cp310-macosx_11_0_arm64.whl

Total release size: 346.7 kB

Release files / olam-1.0.4.tar.gz

Download URL olam-1.0.4.tar.gz
Size 100.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1c20bc4fae2c5068014e18aca433507dfc18647dda194b781d84b260c603c0a6
BLAKE2b-256 checksum
How to use checksums
fa7aa523d342a93d1c8aaedf167ac90144f92cb7de7a88ae4658d87074b269e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.13

Release files / olam-1.0.4-cp310-cp310-macosx_11_0_arm64.whl

Download URL olam-1.0.4-cp310-cp310-macosx_11_0_arm64.whl
Size 246.3 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
48523f72adbe0563f325ef0a06d89e5d68ee3d74b6690ac08dd4e66dae90529b
BLAKE2b-256 checksum
How to use checksums
cc73c7b91c1f3d26f1f1936ad0bced4f927901d82db615ed77a833bdfbe989f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.13

Security for olam 1.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page