sc3.GetTaskVar(person,day,phase,task name)
is the format.
It is the phase task mode version of GetShiftVar.
Use GetTaskVar instead of GetShiftVar.
The following is a description of the project sample sudoku_task.nurse3.
TaskVar is used instead of GetShiftVar.
import sc3
for day in AllDays: #Column constraint
for ph in range(3):
for task in taskdef.keys():
s='PythonColumnConstraint_'+daydef[day]+' '+task +'\n'
sc3.print(s)
V=[]
for person in A_Member_in_All:
V.append(sc3.GetTaskVar(person,day,ph,task))
sc3.AddHard(sc3.SeqLE(1,1,V),s)
for person in A_Member_in_All:#Row constraint
for task in taskdef.keys():
V=[]
s='Python_Row_Constraint_'+staffdef[person]+' '+task+'\n'
for day in AllDays:
for ph in range(3):
V.append(sc3.GetTaskVar(person,day,ph,task))
sc3.AddHard(sc3.SeqLE(1,1,V),s)
for person in BlockTop: #Block constraint
for day in AllDays:
for task in taskdef.keys():
V=[]
s='Python_Block_Constraint_'+staffdef[person]+' '+daydef[day]+' '+task+'\n'
for i in range(3):
for j in range(3):
V.append(sc3.GetTaskVar(person+i,day,j,task))
sc3.AddHard(sc3.SeqLE(1,1,V),s)