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

Restricting period for resource using range #80

Open
contrerasandres opened this issue Mar 14, 2019 · 0 comments
Open

Restricting period for resource using range #80

contrerasandres opened this issue Mar 14, 2019 · 0 comments

Comments

@contrerasandres
Copy link

I'm using the range method to restrict a resource

R = S.Resource('R',periods=range(0,21,3)

I was expecting this resource to only be available in periods 0, 3, 6, 9, 12, 15, 18.

`from pyschedule import Scenario, solvers, plotters, alt

S = Scenario('nozzle',horizon=20)

two resources

R1 = S.Resource('R1',periods=range(0,21,3))
R2 = S.Resource('R2',periods=range(1,21,3))

T1 = S.Task('T1',length=1,delay_cost=1)
T2 = S.Task('T2',length=2,delay_cost=1)

T1 += R1 | R2
T2 += R1 | R2

solvers.mip.solve(S,msg=1)
print(S.solution())`

Result: [(T2, R1, 0, 2), (T1, R2, 1, 2)]

I was expecting '[(T2, R1, 0, 3), (T1, R2, 1, 1)]'

Am I using the range function incorrectly?

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

1 participant