A package to solve resource-constrained scheduling problems using SMT theory/solver.
Project description
ProcessScheduler
A python library to compute resource-constrained task schedules. Documentation at https://processscheduler.readthedocs.io/
About
The computation is based on a set of constraints expressed under the form of first-order logic assertions. Problem solving is performed by the SMT Z3Prover. This project was inspired by the work from Tim Nonner at https://github.com/timnon/pyschedule.
import processscheduler as ps
# a simple problem, without horizon (solver will find it)
pb = ps.SchedulingProblem('HelloWorldProcessScheduler')
# add two tasks
task_hello = ps.FixedDurationTask('Process', duration=2)
task_world = ps.FixedDurationTask('Scheduler', duration=2)
# precedence constraint: task_world must be scheduled
# after task_hello
c1 = ps.TaskPrecedence(task_hello, task_world, offset=0)
pb.add_constraint(c1) # explicitly add this constraint to the problem
# solve
solver = ps.SchedulingSolver(pb)
solution = solver.solve()
# displays solution, ascii or matplotlib gantt diagram
solution.render_gantt_matplotlib()
Install
Install with pip.
pip install ProcessScheduler
The Z3 theorem prover is the only required dependency.
Optional dependencies:
- matplotlib (Gantt chart rendering),
- plotly (Gantt chart rendering).
Features
- tasks: zero duration task, fixed duration task, variable duration task, work amount, optional task,
- resources: worker, cumulative workers, workers selection, cost_per_period and productivity attributes,
- task constraints: precedence, start synced, end synced, start at, end at, start after, end before,
- optional tasks,
- optional task constraints: task schedule condition, tasks schedule dependencies,
- resource constraints: AllSameSelected, AllDifferentSelected,
- optional resource constraints,
- first-order-logic operations (not, or, xor, and, implies, if/then/else) between task or resource constraints,
- builtin indicators (resource utilization, resource cost),
- customized indicators,
- SAT/SMT solver with or without optimization,
- objective (makespan, flowtime, earliest, latest, resource cost),
- exporters: smtlib2.0, json
- Gantt chart rendering using matplotlib or plotly
Jupyter notebooks
There are some Jupypter notebooks. They can be executed online at myBinder.org
Code quality
ProcessScheduler uses the following tools/methods to ensure code quality:
- unittests,
- code coverage (coverage.py, codecov.io),
- continuous-integration at MS azure,
- static code analysis (codacy),
- spelling mistakes tracking (codespell)
License/Author
ProcessScheduler is distributed under the terms of the GNU General Public License v3 or (at your option) any later version. It is currently developed and maintained by Thomas Paviot (tpaviot@gmail.com).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ProcessScheduler-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36f139d487adbd0c3d0760f383e98a7303cbb1f09abc33d8ab231b0c08081fd3 |
|
MD5 | 602a3ed9a8148597a846c3255c6419db |
|
BLAKE2b-256 | 32a063df774861d297aec64b64233e7ccd6ab0590dd54d5c2606963da9c0d974 |