You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have to set up some TIGHTPLUS constraints in order to separate my tasks by a few time units: but how to set a difference between 2 tasks without knowing their order ?
For example, I'm using such TIGHTPLUS ... S += Games[11] + 1 <= Games[10],
but I don't want to set an order. I want tasks Games[11] and Games[10] to be separated by 1 time unit whatever the order they will be appearing ...
The text was updated successfully, but these errors were encountered:
In the following script, breaks are schedule between tasks, maybe sth similar can be applied to your case. Note the is_group, since will speed up the computation, since the breaks are probably all similar, so we can treat them as an interchangeable group.
#! /usr/bin/env python
import sys
sys.path.append('../src')
from pyschedule import Scenario, solvers, plotters
horizon = 20
S = Scenario('Scenario',horizon=horizon)
tasks = S.Tasks('T',num=int(horizon/2),is_group=True,completion_time_cost=1,state=1)
breaks = S.Tasks('B',num=int(horizon/2),is_group=True,completion_time_cost=1,state=-1)
R = S.Resource('R')
tasks += R
breaks += R
# ensure that state is always between 0 and 1
for t in range(horizon):
S += R['state'][:t] <= 1
S += R['state'][:t] >= 0
solvers.mip.solve(S, msg=1)
plotters.matplotlib.plot(S, fig_size=(10, 5))
#plotters.matplotlib.plot(S, fig_size=(10, 5), hide_tasks=breaks)
Hi,
I have to set up some TIGHTPLUS constraints in order to separate my tasks by a few time units: but how to set a difference between 2 tasks without knowing their order ?
For example, I'm using such TIGHTPLUS ... S += Games[11] + 1 <= Games[10],
but I don't want to set an order. I want tasks Games[11] and Games[10] to be separated by 1 time unit whatever the order they will be appearing ...
The text was updated successfully, but these errors were encountered: