Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit number of resources for a task for period #71

Open
PIYUSHASOLKAR opened this issue Nov 16, 2018 · 1 comment
Open

Limit number of resources for a task for period #71

PIYUSHASOLKAR opened this issue Nov 16, 2018 · 1 comment

Comments

@PIYUSHASOLKAR
Copy link

PIYUSHASOLKAR commented Nov 16, 2018

Is there any way to limit number of resources for a task for a period..
For the code, I want to limit only two resource to cook at a time and cooking can be done once in 3 hrs.
So the third resource should cook before or after a span of 2 hrs
expected result :
[(cook, Alice, 0, 1), (cook, Bob, 0, 1), (cook, Jim, 3, 4), (MakeSpan, Alice, 4, 5)]

code:
from pyschedule import Scenario, solvers, plotters
S = Scenario('hello_pyschedule',horizon=10)
Alice, Bob = S.Resource('Alice'), S.Resource('Bob')
Jim=S.Resource('Jim')
cook= S.Task('cook',1)
S += cook % (Alice,Bob,Jim)
S.use_makespan_objective()
solvers.pulp.solve(S,msg=1)
print(S.solution())
plotters.matplotlib.plot(S,fig_size=(8,4))

@timnon
Copy link
Owner

timnon commented Dec 24, 2018

look into capacity constraints, this can be easily modelled using them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants