Skip to main content

Metric Hybrid Factored Planning in Nonlinear Domains with Constraint Generation in Python.

Project description

SCIPPlan

SCIPPlan [1,2,3] is a SCIP-based [4] hybrid planner for domains with i) mixed (i.e., real and/or discrete valued) state and action spaces, ii) nonlinear state transitions (which can be specified as ODEs or directly as solution equations) that are functions of time, and iii) general reward functions. SCIPPlan iteratively i) finds violated constraints (i.e., zero-crossings) by simulating the state transitions, and ii) adds the violated (symbolic) constraints back to its underlying optimisation model, until a valid plan is found.

Example Domain: Navigation

Figure 1: Visualisation of different plans generated by SCIPPlan [1,2,3] for example navigation domains where the red square represents the agent, the blue shapes represent the obstacles, the gold star represents the goal location and the delta represents time. The agent can control its acceleration and the duration of its control input to modify its speed and location in order to navigate in a two-dimensional maze. The purpose of the domain is to find a path for the agent with minimum makespan such that the agent reaches its the goal without colliding with the obstacles.

Note that SCIPPlan does not linearise or discretise the domain to find a valid plan.

Dependencies

i) Solver: SCIP (the current implementation uses the python interface to the SCIP solver, i.e., PySCIPOpt [5]). This version of SCIPPlan has only been tested on PySCIOpt>=4.0.0 using earlier an version of pyscipopt may result in unintended behaviour.

ii) Symbolic Mathematics: SymPy [6].

Installing and Running SCIPPlan

In order to Install SCIPPlan you need to ensure you have a working version of the SCIP optimisation suite on your system which can be installed from the SCIP website. For more information about SCIP and PySCIPOpt refer to this installation guide.

After installing SCIP you will be able to install SCIPPlan using

pip install scipplan

Now you will be able to run some of the example domains which include

  • Navigation (3 instances)

To run one of these examples all you need to do is run

scipplan -D navigation -I 1

which will run the 1st instance of the navigation domain using the ODEs as the transition function with the help of SymPy [6]. Similarly, the command

scipplan -D navigation -I 1 --provide-sols

will run the the 1st instance of the navigation domain using the solution equations as the transition function. For more information regarding the available tags and what they mean run scipplan --help.

Alternatively you can import scipplan classes to run it using python.

from scipplan.scipplan import SCIPPlan
from scipplan.config import Config
from scipplan.helpers import write_to_csv

this will import the only two classes and function needed to run SCIPPlan. Then to set the configuration either create an instance of the Config class by setting the params or by retrieving the cli input

# Set params
config = Config(domain="navigation", instance=1)
# Retrieve cli args
config = Config.get_config()

after which you are able to solve problem by either using the solve or optimize methods

# The optimize method just optimises the problem for the given horizon
plan = SCIPPlan(config)
plan.optimize()
# Class method which takes input the config, solves the problem 
# with auto incrementing the horizon until a solution is found then 
# returns the plan as well as the time taken to solve the problem
plan, solve_time = SCIPPlan.solve(config)  

In order to save the generated constraints for the horizon solved as well as the results, use the following code

write_to_csv("new_constraints", plan.new_constraints, config)
write_to_csv("results", plan.results_table, config)

Citation

If you are using SCIPPlan, please cite the papers [1,2,3] and the underlying SCIP solver [4].

References

[1] Buser Say and Scott Sanner. Metric Nonlinear Hybrid Planning with Constraint Generation. In PlanSOpt, pages 19-25, 2018.

[2] Buser Say and Scott Sanner. Metric Hybrid Factored Planning in Nonlinear Domains with Constraint Generation. In CPAIOR, pages 502-518, 2019.

[3] Buser Say. Robust Metric Hybrid Planning in Stochastic Nonlinear Domains Using Mathematical Optimization. In ICAPS, pages 375-383, 2023.

[4] SCIP

[5] PySCIPOpt

[6] SymPy

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

scipplan-0.2.1a0.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

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

scipplan-0.2.1a0-py2.py3-none-any.whl (21.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file scipplan-0.2.1a0.tar.gz.

File metadata

  • Download URL: scipplan-0.2.1a0.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for scipplan-0.2.1a0.tar.gz
Algorithm Hash digest
SHA256 c2a9896513e3d83fa438b4b338307f3937dd2eef10e12af263e251f1b6cf0d20
MD5 1c87ded213516ce69964e9568b2a5bc1
BLAKE2b-256 5417f55873614079f657d26e38e42f7efa8c7a64e32e3316d30526ddb17739ea

See more details on using hashes here.

File details

Details for the file scipplan-0.2.1a0-py2.py3-none-any.whl.

File metadata

  • Download URL: scipplan-0.2.1a0-py2.py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for scipplan-0.2.1a0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9a679720216020bcd058d409328c4daea1cc091303ad68ef524b3487e4bf4ba7
MD5 868e7ca2e0d22a0e54679011637d3f7e
BLAKE2b-256 8d15d4719579840db9c14800dd75f8863fc80b5ec3436ee820d8fd294dc9d5e8

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