Metadata-Version: 2.1
Name: macq
Version: 0.3.11
Summary: Action model acquisition from state trace data.
Author: Ethan Callanan, Rebecca De Venezia, Victoria Armstrong, Alison Parades, Tathagata Chakraborti
Author-email: Christian Muise <christian.muise@queensu.ca>
Maintainer-email: Christian Muise <christian.muise@queensu.ca>
License: MIT License
        
        Copyright (c) 2020 Queen's Mu Lab
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://macq.planning.domains
Project-URL: Documentation, https://ai-planning.github.io/macq/
Project-URL: Repository, https://github.com/ai-planning/macq
Keywords: planning,action model acquisition
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tarski
Requires-Dist: requests
Requires-Dist: rich
Requires-Dist: nnf
Requires-Dist: python-sat
Requires-Dist: bauhaus
Requires-Dist: numpy
Requires-Dist: clingo
Requires-Dist: graphviz
Requires-Dist: networkx
Requires-Dist: pydot
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"

# MAcq: The Model Acquisition Toolkit

[![CI](https://github.com/ai-planning/macq/actions/workflows/check.yml/badge.svg)](https://github.com/ai-planning/macq/actions)
[![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/haz/03ac305b42d7c9ad4ef3213341bf3f2f/raw/macq__heads_main.json?cacheSeconds=3600)](https://github.com/ai-planning/macq/actions)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![License](https://img.shields.io/badge/license-MIT-purple)](https://github.com/ai-planning/macq/blob/main/LICENSE)

This library is a collection of tools for planning-like action model acquisition from state trace data. It contains a reimplementation from many existing works, and generalizes some of them to new settings.

## Example Usage

```python
from macq import generate, extract
from macq.observation import IdentityObservation, AtomicPartialObservation

# get a domain-specific generator: uses api.planning.domains problem_id/
# generate 100 traces of length 20 using vanilla sampling
traces = generate.pddl.VanillaSampling(problem_id = 123, plan_len = 20, num_traces = 100).traces

traces.generate_more(10)

action = traces[0][0].action
traces.get_usage(action)
# [0.05, 0.05, ..., 0.05]

trace = traces[0]
len(trace)
# 20

trace.fluents
trace.actions
trace.get_pre_states(action) # get the state before each occurance of action
trace.get_post_states(action) # state after each occurance of action
trace.get_total_cost()
```

## Survey

You can find the full scope of papers considered in the survey (implemented and otherwise) at http://macq.planning.domains . This repository of model acquisition techniques will be added to over time.

## Related Survey Papers

- [A Review of Machine Learning for Automated Planning](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.231.4901&rep=rep1&type=pdf) (see Fig 2)
- [A Review of Learning Planning Action Models](https://hal.archives-ouvertes.fr/hal-02010536/document) (see Tbl 3)

## Citing this work

```latex
@inproceedings{macq-keps-2022,
  author    = {Ethan Callanan and Rebecca De Venezia and Victoria Armstrong and Alison Paredes and Tathagata Chakraborti and Christian Muise},
  title     = {MACQ: A Holistic View of Model Acquisition Techniques},
  booktitle = {The ICAPS Workshop on Knowledge Engineering for Planning and Scheduling (KEPS)},
  year      = {2022}
}
```
