Minizinc problem solver
Project description
cooked-tomato
Timetable scheduler for phone attention turns in Som Energia
History
This project is the result of an internal Som Energia Hackathon held on 11-03-2022 about MiniZinc with the goal of reimplementing the previous solution based on a pruned backtracking.
Prerequisites
Before you begin, ensure you have met the following requirements:
- You must have at least
python 3.8
. You can get this python version throughpyenv
. See more here -> https://github.com/pyenv/pyenv#installation - You should have a
Linux/Mac
machine. Windows is not supported and we are not thinking in it.
Installation
pip install cooked-tomato
Usage
import asyncio
from tomato_cooker.grill import GrillTomatoCooker
from tomato_cooker.models import TomaticProblem, tomatic
# define a problem
tomatic_problem_params = {
"nPersons": 4,
"nLines": 2,
"nHours": 3,
"nNingus": 1,
"nDays": 5,
"maxTorns": 2,
"nTorns": [3, 3, 3, 3,],
"indisponibilitats": [
{1}, {1}, {2}, {1}, {1},
{2}, {2}, {2}, {2}, {2},
{3}, {3}, {2}, {3}, {3},
{2}, {3}, {2}, {2}, {1},
]
}
tomatic_problem = TomaticProblem(**tomatic_problem_params)
# choose a list of minizinc solvers to user
solvers = ["chuffed", "coin-bc"]
# create an instance of the cooker
tomato_cooker = GrillTomatoCooker(tomatic.MODEL_DEFINITION_PATH, solvers)
# Now, we can solve the problem
solution = asyncio.run(tomato_cooker.cook(tomatic_problem))
print(solution)
Contribute
- Fork the repository on GitHub.
- Set up your development setup
$> pip install -e .[dev,tests]
- Run the tests to confirm they all pass on your system.
$> pytest
- Make your change and run the entire test suite again and confirm that all tests pass including the ones you just added.
- Create us a GitHub Pull Request to the main repository’s master branch. GitHub Pull Requests are the expected method of code collaboration on this project.
Changes
License
This project uses the following license: GNU AFFERO GENERAL PUBLIC LICENSE.
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
tomato-cooker-0.2.1.tar.gz
(20.1 kB
view details)
Built Distribution
File details
Details for the file tomato-cooker-0.2.1.tar.gz
.
File metadata
- Download URL: tomato-cooker-0.2.1.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac1c0ac79b06325cf734a073147ed386b5dbb13c258b117a7114ff5b7a684a7c |
|
MD5 | 81a3fae564dea59c4e5291560bdc1dc7 |
|
BLAKE2b-256 | 905400be5f2535dac905c6b039c245eb58d1f6310a0560aa4baaed852f848085 |
File details
Details for the file tomato_cooker-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: tomato_cooker-0.2.1-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20066627294bfa66bafd07b4ea17c5561d8342393c6603e158fa2fa8232d394b |
|
MD5 | 579dff08bbbf17f6019a87dfb9b38b33 |
|
BLAKE2b-256 | 7b4701415b59d1318ea8cd70c734aa4098727d9c46b16549d343496b308f8512 |