Example of solving a shift assignment problem using Pyomo.
The app is hosted, managed and versioned by Nextmv.
Install requirements:
pip3 install -r requirements.txt
Run the command below to check that everything works as expected:
python3 main.py -input input.json -output output.json -duration 30 -provider cbc
A file output.json
should have been created with the solution.
Push the app to Nextmv:
nextmv app push -a shift-assignment-pyomo
Make a run:
nextmv app run -a shift-assignment-pyomo -i input.json -w > output.json
Create a new instance with a new version of the app:
VERSION_ID=$(git rev-parse --short HEAD)
nextmv app version create \
-a shift-assignment-pyomo \
-n $VERSION_ID \
-v $VERSION_ID
nextmv app instance create \
-a shift-assignment-pyomo \
-v $VERSION_ID \
-i candidate-1 \
-n "Test candidate 1"
Create an acceptance test:
NEXTMV_API_KEY="<YOUR-API-KEY>"
ACCEPTANCE_TEST_ID=$(git rev-parse --short HEAD)
INPUT_SET_ID="<AN-INPUT-SET-ID>"
python ci-cd-tests.py