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

Group tasks with different duration #79

Open
ollamh opened this issue Mar 6, 2019 · 0 comments
Open

Group tasks with different duration #79

ollamh opened this issue Mar 6, 2019 · 0 comments

Comments

@ollamh
Copy link

ollamh commented Mar 6, 2019

Hi @timnon !

I have another question (and possible bug) when using tasks grouping:

       import pyschedule
       s = pyschedule.Scenario('test_periods', horizon=400)
       t1 = s.Task('Graphics_1', length=4, delay_cost=1 , group='1')
       t2 = s.Task('Graphics_2', length=2, delay_cost=1, group='1')
       t3 = s.Task('Graphics_3', length=4, delay_cost=1,group='1')
       t4 = s.Task('Graphics_4', length=4, delay_cost=1,group='2')
       t5 = s.Task('Graphics_5', length=1, delay_cost=1,group='2')
       t6 = s.Task('Graphics_6', length=2, delay_cost=1)
       t7 = s.Task('Graphics_7', length=2, delay_cost=1)

       resource1 = s.Resource('Dep', periods=range(0,400))
       resource2 = s.Resource('Deep', periods=range(0,400))
       resource3 = s.Resource('Deeep', periods=range(0,400))

       s += t6 > t5
       s += t6 > t4
       s += t6 > t3
       s += t6 > t2
       s += t6 > t1
       s += t7 > t6
       t1 += resource1
       t2 += resource1
       t3 += resource1
       t4 += resource1
       t5 += resource1
       t6 += resource2
       t7 += resource3

       pyschedule.solvers.mip.solve(s, kind='CBC', msg=1, ratio_gap=1.2)
       print(s.solution())
       pyschedule.plotters.matplotlib.plot(
           s, resource_height=100.0)

I create manually a group of tasks of different duration, but when I get the results I see gaps between tasks in the same group, as the code logic assumes that all tasks in the group have equal duration. Is it a bug?

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