I have this problem while trying to find a solution for a resource constraint scheduling problem. Whenever I put dvar as a condition in a forall loop or if condition I have the error that states "Decision variable (or expression) "S" not allowed".
range activity = 1..16;
dvar float+ S[activity];
dvar float+ rd[jobs];
forall (i in activity)
forall (t in T:S[i]<=t<=S[i]+D[i]) //boolean b
b[i][t]==1;
forall (t in T)
forall (k in R)
sum (i in activity)b[i][t]*V[i][k]<=Rk[k];//human resources constraint
forall (j in jobs)
forall (t in T:rd[j]<=t<=S[maxact[j]])//boolean y
y[j][t]==1;