Originally posted by: charles123123
Dear all,
I'm a new user of CPLEX for my thesis work. I'm constantly getting an error as Decision Variable (expression) not allowed.
I'm getting some error as "Decision variable (or expression) "D" not allowed".
For your reference, I have the code of the project.
{string} staff = ...;
{string} service = ...;
int P = ...;
range plot = 0..P;
tuple edge {int i; int j;}
setof(edge) Edges = {<i,j> | i,j in plot};
float cost1[Edges] = ...;
float cost2[staff][service] = ...;
float e[plot] = ...;
float l[plot] = ...;
int r[Edges] = ...;
// Decision variables
dvar boolean x[Edges][staff][service];
dvar float A[plot];
dvar float D[plot];
// Objective
minimize sum (<i,j> in Edges, h in staff, k in service)(cost1[<i,j>]+cost2[h,k])*x[<i,j>,h,k];
subject to {
forall (i in plot)
e[i]<=A[i]<=l[i];
forall (i in plot)
D[i]==maxl(A[i]+T1[i],e[i]+T1[i]);
forall (<i,j> in Edges : j!=0, h in staff, k in service)
if(D[i]+T1[j]+T2[<i,j>]<=r[<i,j>]*D[j]){x[<i,j>,h,k]==0;}
}
#CPLEXOptimizers#DecisionOptimization