sc3.SeqExpr(min,max,Type,List)

â–  SeqExpr is a constraint function that returns the result of SeqLE in 1 bit. True is returned when satisfied. The type is specified as follows.

Type 0: ΣList <=max
Type 1: ΣList >=min
Type 2: ΣList >=min && ΣList <=max

Since the result will be an ordinary boolean variable, it can also be used to make a hard or soft constraint.

â–  Sample is seq_expr.nurse3. Note that there is a soft error in staff6, but the cost is 1.

AddSoft counts the number of false bits. The optimal system acts to minimize the total cost.
When False is returned from SeqExpr, the inequality constraint is not satisfied. It does not sense how many bits are in error in the inequality part.
When True is returned from SeqExpr, the inequality constraint is satisfied.

import sc3




def Set_Day_Offs():
    for person in Day_Offs_per_Month.keys():
		#sc3.print(str(person)+'\n')
        value=Day_Offs_per_Month[person]
        print(staffdef[person]+' Day Offs are '+str(value))

        max=value
        min=value
        type=2
        list=[]
        for day in ThisMonth:
            list.append(sc3.GetShiftVar(person,day,'Day Off'))
        s="person"+str(person)+"Number of Day Offs"
        A=sc3.SeqExpr(min,max,type,list)
        sc3.AddSoft(A,s,2) #Count false for level2


Set_Day_Offs()