tpaviot / ProcessScheduler

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

Warning with Workload constraint #48

Closed dreinon closed 3 years ago

dreinon commented 3 years ago

I'm adding a workload constraint which dict_time_intervals_and_bound is the following:

{(0, 13): 3, (13, 26): 3, (26, 39): 3, (39, 52): 3, (52, 65): 3, (0, 65): 10}

being my horizon 65.

If I add the constraint before assigning tasks to the resource, I get the following warning: /home/dani/dribo/trial/ProcessScheduler/processscheduler/base.py:81: UserWarning: assertion True already added. warnings.warn('assertion %s already added.' % z3_assertion)

If I add the constraint after tasks are assigned, it works. Is the constraint intended to work like this? Thank you!

tpaviot commented 3 years ago

I cannot duplicate the issue, can you please provide a simple test case?

tpaviot commented 3 years ago

I looked at the related code, you're right: the resource has to be assigned to the tasks before the WorkLoad constraint can be safely added.

dreinon commented 3 years ago

Okay, closing the issue and opening one for performance.