Hello i started recently using Cplex to solve mathematical models. i have a question about how to express a dynamic range (depends on another decision variable. The models aims to find the number of lots and the size of each lot knowing the total number of products and the max/min constraints of the size of each products .
int M =...;
range moteurs = 1 .. M;
int Vj[moteurs]= ... ;
int Minj[moteurs] = ...;
int Maxj[moteurs] = ...;
dvar int+ X[moteurs];
range a =1..X[moteurs] ; // the problem is here
dvar int+ W[moteurs][a] ;
minimize sum (j in moteurs) X[j];
subject to {
forall (j in moteurs, i in a)
W[j][i] <= Maxj[j];
forall (j in moteurs, i in a)
W[j][i] >= Minj[j];
forall (j in moteurs)
sum(i in a) W[j][i]==Vj[j];
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…