Closed dreinon closed 3 years ago
You must pass a list of constraints, even if there's only one constraint
ps.implies(t1.start/13 < 4,[ps.TaskStartAfterLax(t2,13*4)])
I'm not sure that you can nest if_then_else
and implies
, let me know
I don't get an error using this notation:
for t1,t2 in permutations(student_tasks,2): constraints.append(ps.if_then_else(t1.start/13 < 1,[ps.TaskStartAfterLax(t2,13)], [ps.if_then_else(t1.start/13 < 2,[ps.TaskStartAfterLax(t2,13*2)], [ps.if_then_else(t1.start/13 < 3,[ps.TaskStartAfterLax(t2,13*3)], [ps.implies(t1.start/13 < 4,[ps.TaskStartAfterLax(t2,13*4)]) ]) ]) ]))
However, I get directly no solution. I'll make some unit tests later.
Any other idea about how to constraint a maximum of n tasks (no minimum) from a list of tasks to be scheduled between a certain interval of time.
For instance, such that a person can do a maximum of 3 tasks between the periods 5-15, and a maximum of 4 between the periods 15-30.
Thanks!
yes, that's planned. What do you exactly mean with "do a max of 3 tasks"? From the periods 5-15, 3 tasks max are started, processed, and completed, right?
Exactly. 3 tasks maximum FROM A LIST OF TASKS. This doesn't mean that there couldn't be more tasks that aren't in that list between this periods,
ok, can you please open a dedicated issue?
Sure. I commented it here since that's what I was trying to do concatenating if-else statements
Addressed at #20
Hello! I'm trying to make that if a student task is scheduled in a certain day (a day has 13 time points), then if another of his tasks is scheduled, it should be scheduled in another day. I'm using the following code:
I'm getting the following error:
Any ideas?? Thanks again!