- This how-to guide assumes you already completed the get started with shift scheduling tutorial.
These are the supported solvers for shift scheduling problems:
Provider | Description | Use with |
---|---|---|
Nextmv | Our shift-scheduling marketplace app. Get started here. | Nextmv marketplace app |
OR-Tools | Open-source solver. | Nextmv platofrm & Python |
When working locally with the Nextmv Platform make sure all necessary assets are up to date by running the following command:
OR-Tools
OR-Tools is an open-source solver. It is a software suite for optimization, tuned for tackling the world's toughest problems in vehicle routing, flows, integer and linear programming, and constraint programming.
- This solver is supported using Python.
- When running locally, this solver is not supported natively using Nextmv's SDK and you need to run with the Python command directly.
- Does not require additional licensing or setup, for running locally or in the cloud.
Get started by initializing the ortools
template. The template contains an example of getting started with Mixed Integer Programming (MIP).
Change directories into the ortools
folder.
We are going to modify the template to solve a sample nurse scheduling problem with shift requests. This is an adapted example taken from the OR-Tools Scheduling guides.
Replace the input.json
contained in the template with sample data for the scheduling problem.
Similarly, replace the main.py
included in the template with the code to solve the problem.
Because this is a Python template, make sure that the requirements described in the requirements.txt
file are installed.
Run the code, specifying the file to be used as input.
After running, the output should have been printed to stdout, similar to this one:
The template contains an app.yaml
manifest that specifies how to execute the app in the cloud.
type
(do not modify this value): specifies that the app uses Python instead of the Nextmv SDK.runtime
(do not modify this value): specifies the docker runtime where the app is run. This value must not be modified because the runtime is specific for OR-Tools.files
: a list of all the files that should be included in the app. Globbing is supported, so you may specify individual files or whole directories. In the simple template, just themain.py
needs to be included.
The OR-Tools runtime has no access to network calls. This means that importing other packages or performing HTTP requests is not yet available. If you would like more Python packages to be supported in the runtime, please contact support.
After running locally, and making sure your app manifest is correctly set up, you may follow the steps for deploying a custom app.