Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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];

}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.3k views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...