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.2a0.tar.gz (18.7 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.2a0-py2.py3-none-any.whl (34.5 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: scipplan-0.2.2a0.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

File hashes

Hashes for scipplan-0.2.2a0.tar.gz
Algorithm Hash digest
SHA256 27d0a1c3fc1a6dfa59f2cc8dda82f67b31d7c2cd002dd96228e21cdb56179ba9
MD5 a15b87a24c0dbbff6a88dc6958462ad4
BLAKE2b-256 989090725c53516b27ea1f6f7a4371e4e3511f15a9de547ab92159e1a26a0190

See more details on using hashes here.

File details

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

File metadata

  • Download URL: scipplan-0.2.2a0-py2.py3-none-any.whl
  • Upload date:
  • Size: 34.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

File hashes

Hashes for scipplan-0.2.2a0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 eff603d2fc3b1472ac5169c4493e1891ab04380fce5d3e78201e52e85633936b
MD5 1d502a3063f51d4b2ca061ac906bcbfd
BLAKE2b-256 240f23996fdec43164998c41d2515a8c2d4eded48bd87b4a9851a1602dc6b29d

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