I'm new to CP and am having some issues getting the Cumulative constraint working properly. Any guidance is really appreciated. I'm solving a RCPSP.
solver = pywrapcp.Solver('Problem')
#Vars
S=[solver.FixedDurationIntervalVar(0,LS[a],Duration[a],False,\
"S_%s"%a) for a in A]
#Objective
Cmax=solver.Max([S[a].EndExpr() for a in A])
print "Adding Precedence Constraint" , time.clock()
#Add Precedence
for (a,aa) in Prec:
#solver.Add(S[aa].StS[a].EndExpr()<= S[aa])
solver.Add(S[aa].StartsAfterEnd(S[a]))
print "Adding Resource Constraints", time.clock()
for r in set(R).intersection(set(r_more)):
ss=[S[a] for a in A if Demand[a,r]>0]
#dd=[Duration[a] for a in A if Demand[a,r]>0]
rr=[Demand[a,r] for a in A if Demand[a,r]>0]
solver.Cumulative(S, rr, Budget[r])
When it gets to this last line it errors out with the following code: NotImplementedError: Wrong number or type of arguments for overloaded function 'Solver_Cumulative'.
I've checked a few examples but not sure how to get it working properly. Thanks in advance.