Metadata-Version: 2.2
Name: pdsim_backend
Version: 0.1
Summary: Using Unified Planning Library to parse PDDL and generate plans for PDSim.
Author-email: Emanuele De Pellegrin <ed50@hw.ac.uk>, Andy Edmondson <ae2016@hw.ac.uk>
Project-URL: Homepage, https://github.com/Cryoscopic-E/PDSim-Backend
Project-URL: Issues, https://github.com/Cryoscopic-E/PDSim-Backend/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENCE
Requires-Dist: pyzmq~=25.1.1
Requires-Dist: requests~=2.31.0
Requires-Dist: protobuf
Requires-Dist: unified-planning==1.1.0
Requires-Dist: up-fast-downward
Requires-Dist: up-tamer
Requires-Dist: up-pyperplan

# PDSim Backend

Using [Unified Planning Library](https://github.com/aiplan4eu/unified-planning) to parse PDDL and generate plans for PDSim



### Availbale planners:
    
- [FastDownward](https://github.com/aibasel/downward)
- [Tamer](https://github.com/aiplan4eu/up-tamer)
- [Pyperplan](https://github.com/aiplan4eu/up-pyperplan)

## Install
- Get the project to have the script and examples available

    `git clone https://github.com/Cryoscopic-E/PDSim-Backend.git`

- Move to project folder

    `cd PDSim-Backend`

- Activate environment (optional)

    `python -m venv venv`
    
    - Linux:
    `source myvenv/bin/activate`
    - Windows (Powereshell):
    `.\venv\Scripts\activate.ps1`
    - Windows (CMD):
    `.\venv\Scripts\activate.bat` 
    
- Install package and requirements for scripting
    
    `pip install pdsim_backend`

This will install the PDSim-Backend python package along with dependencies. It can now be used from python or as a cli script.


## Usage

### Python Mode

```python
from pdsim_backend import run_backend

run_backend(domain='./examples/pddl/blocks/domain.pddl', problem='./examples/pddl/blocks/problem.pddl')
```


### CLI Mode 

 - Provide your domain and problem files.

`python pdsim_unity.py --domain <domain_path> --problem <problem_path>`

You can provide an optional `--planner` flag, by default it'll use fast-downward, but the user will be prompted which planner is available for a specific problem.

 - Embed pdsim server in your up problem definition.

````
from pdsim_unity import pdsim_upf

< your  problem definition >

pdsim_upf(up_problem, planner_name)

````

This will create a server to communicate with unity and serve the protobuf representation of the problem and the generated plan.
