tpaviot / ProcessScheduler

A Python package for automatic and optimized resource scheduling
https://processscheduler.github.io/
GNU General Public License v3.0
59 stars 18 forks source link

First commit for ResourceCapacity constraint #30

Closed tpaviot closed 3 years ago

tpaviot commented 3 years ago

This branch adds a new ResourceCapacity constraint:

c1 = ps.ResourceCapacity(worker_1, {(4, 8): 0, (10, 42): 4})

means that the resource worker_1 cannot be used between 4 and 8, and can be used at most for 4 timeslots between 10 and 42.

ping @dreinon

tpaviot commented 3 years ago

Issues to solve:

codecov-commenter commented 3 years ago

Codecov Report

Merging #30 (98fe040) into master (04219e2) will decrease coverage by 0.21%. The diff coverage is 91.13%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #30      +/-   ##
==========================================
- Coverage   97.89%   97.67%   -0.22%     
==========================================
  Files          23       24       +1     
  Lines        2467     2536      +69     
==========================================
+ Hits         2415     2477      +62     
- Misses         52       59       +7     
Impacted Files Coverage Δ
processscheduler/__init__.py 86.66% <ø> (ø)
processscheduler/resource_constraint.py 90.47% <83.33%> (-9.53%) :arrow_down:
test/test_capacity.py 96.77% <96.77%> (ø)
processscheduler/solver.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 04219e2...98fe040. Read the comment docs.

dreinon commented 3 years ago

Issues to solve:

  • [ ] add unittest for differents kinds

  • [x] fix unittests (one is failing)

  • [ ] maybe change the class name. Since the kind can be exact, atleast or atmost, the ResourceCapacity name is perhaps not the most explicit, maybe ResourceWorkload?

I agree with you in 3rd point. I find workload more descriptive.