# Operator error in operating cost model constraint

I have built a model to minimize the operating cost and when I coded a model in CPLEX, it gave an error at Cons09: Function operator/(int,dvar int+) not available in context CPLEX. I think maybe the problem lies in my model design as it is a big model. Here are my parameters:

int Numtask =...;
int Numresource =...;

range Resource = 1..Numresource;

// parameters

int C[Resource]=...;// cost of engineer t
int A[Task]=...;// nightstop time of t
float B=0.15;
int M=9000;


Here are my decision variables:

dvar float+ g[Resource];
dvar float+ nmax[Resource];
dvar float+ bmin[Resource];

dexpr float cost =sum(t in Resource) C[t]*g[t];

minimize (cost);


My constraints are as follows:

  subject to{
//cons01:
forall(j in Task, t in Resource)
x[t][j]==a[t][j];

//cons02:
sum(t in Resource) x[t][j]==1;

//cons03:
forall(t in Resource)

//cons04:
sum(t in Resource) x[t][j]*a[t][j]<=2;

//subcons04:
man[j]==sum(t in Resource) x[t][j]*a[t][j];
}

//cons05:

//cons06:
forall(t in Resource){
g[t]>=(1+B)*sum(t in Resource, j in Task)x[t][j]*a[t][j];
}

//cons07:
m[j]>=A[j]&&m[j]<=A[j]+30;
}

//cons08:
forall(t in Resource, j in Task){
b[t][j]==M*(1-x[t][j])+m[j];
}

//cons09:
forall(t in Resource, j in Task){
n[t][j] == b[t][j]+h[j]/man[j];
}

//cons10:
forall(t in Resource, j in Task){
n[t][j]<=1770;
}

//cons11:
forall(t in Resource){
nmax[t]-bmin[t]<=720;
}
//subcons11:
forall(t in Resource, j in Task){
nmax[t]>=n[t][j];
}
//subcons11:
forall(t in Resource, j in Task){
bmin[t]<=b[t][j];
}
//cons12:
forall(t in Resource){
}

}


How can I fix this?

• please give a more descriptive title to your question, that way other's who run into the same problem can benefit from the answers as well. Sep 23 at 18:11

Integer programming models solved by CPLEX (or most other solvers) require linear or, in certain very limited cases, quadratic constraints. Your constraint 9 involves dividing a parameter (h) by an integer variable (man), which results in a nonlinear expression. Multiplying both sides by man will not help, since that produces an equation with products of variables, which is not among the limited cases where quadratic constraints are allowed.
Assuming that man[j] can never be 0 and has an upper bound of M, you can add binary variables z[j][i] (j in Task, i in 1...M), where z[j][i] = 1 means man[j] = i. Add the constraint that z[j][1] + ... + z[j][M] = 1, and the constraint that man[j] = z[j][1] + 2*z[j][2] + ... + M*z[j][M]. The term h[j]/man[j] in constraint 9 can now be replaced with h[j]*(z[j][1] + 1/2*z[j][2] + ... + 1/M*z[j][M]).