Originally posted by: Marco_T_from_W
Hello,
i'am new in programming and OPL and i need to get a production model running.
Unfortunately some errors occur even in the basic/simplified mode (see all the out comment lines).
I hope someone here can help me with it!
First the mod.file:
using CPLEX;
int ANZSTUF = ...;
range STUF = 1..ANZSTUF;
int ANZTAKT = ...;
range TAKT = 1..ANZTAKT;
//int TSTART = ...;
//int BTOT = ...;
int X
STUF = ...;
int INITY
STUF = ...;
int MAXANZW
TAKT,STUF = ...;
dvar int Y
STUF,TAKT;
//dvar int ANZW
STUF,TAKT;
dvar int Q
STUF,TAKT;
//dvar int X
STUF;
//dvar int INITY
STUF;
dexpr float PR =
sum (k in STUF: k == 5, t in TAKT) Q
k,t/10;
maximize PR;
subject to {
forall(k in STUF, t in TAKT: t == 1)
<----ERROR: Unable to create constraint; internal error:: array
Lagerbil_Start: INITY[k] + Q
k,t - Y
k,t == Q
k + 1, t == 2; unsupported slot index bei ../../../src/loader.cpp:3611.
forall(k in STUF, t in TAKT: t>= 2 && t<=9)
Lagerbil_Mitte: Y
k,t - 1 + Q
k,t - Y
k,t == Q
k + 1,t + 1;
forall(k in STUF, t in TAKT: t == 10)
Lagerbil_Ende: Y
k,t - 1 + Q
k,t - Y
k,t == 0;
//forall(k in STUF, t in TAKT: t == 1)
//Pufferkapa_1: INITY
k,t <= X[k];
//forall(k in STUF, t in TAKT: t>=2 && t<=10)
//Pufferkapa_2: INITY
k,t + 1 <= X[k];
//forall(k in STUF, t in TAKT)
//Pufferkapagesamt: sum (Y in k) X[Y] == BTOT
t,k;
forall(k in STUF, t in TAKT)
Produktionskapa: Q
k,t <= MAXANZW
k,t;
//forall(k in STUF, t in TAKT == 1)
//Palettenanz_1: INITY[k] + Q
k,1 == ANZW;
//forall(k in STUF, t in TAKT + 1)
//Palettenanz_2: Y
k,t + Q
k, t + 1 == ANZW;
//forall(k in STUF, t in TAKT)
//NichtNeg_1: ANZW >= 0;
forall(k in STUF, t in TAKT)
NichtNeg_2: Q
k,t >= 0;
forall(k in STUF, t in TAKT)
NichtNeg_3: Y
k,t >= 0;
forall(k in STUF, t in TAKT)
NichtNeg_4: PR >= 0;
//forall(k in STUF, t in TAKT)
//NichtNeg_5: INITY
k,1 >= 0;
}
dat.file:
ANZSTUF = 5;
ANZTAKT = 10;
X =
2, 2, 2, 2, 2;
INITY =
1, 1, 1, 1, 1;
MAXANZW = [
1, 0, 0, 1, 1,
1, 1, 2, 1, 1,
1, 1, 1, 1, 0,
0, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1] ;
If i "out comment" the (necessary) first constraint (see Error description obove) even more errors occur:
-
CPLEX can not extract the model: IloAlgorithm cannot extract extractable.
-
CPLEX can not extract the expression: forall(k in 1..5, t in 1..10: 2 <= t && t <= 9) Lagerbil_Mitte: Y(k)(t+(-1))+Q(k)(t)+Y(k)(t)*(-1) == Q(k+1)(t+1).
-CPLEX can not extract the expression: forall(k in 1..5, t in 1..10: 2 <= t && t <= 9) Lagerbil_Mitte: Y
(k)(t+(-1))+Q
(k)(t)+Y
(k)(t)*(-1) == Q
(k+1)(t+1).
-
CPLEX can not extract the expression: forall(k in 1..5, t in 1..10) Produktionskapa: Q(k)(t) <= MAXANZW(k)(t).
-
CPLEX can not extract the expression: forall(k in 1..5, t in 1..10) Produktionskapa: Q(k)(t) <= MAXANZW(k)(t).
-
Index for Array "MAXANZW(1)" is out of valid range: 6.
-
Index for Array "Q" is out of valid range: 6.
-
OPL can not extract the expression: forall(k in 1..5, t in 1..10: 2 <= t && t <= 9) Lagerbil_Mitte: Y(k)(t+(-1))+Q(k)(t)+Y(k)(t)*(-1) == Q(k+1)(t+1).
-
OPL can not extract the expression: forall(k in 1..5, t in 1..10) Produktionskapa: Q(k)(t) <= MAXANZW(k)(t).
-
OPL can not extract the expression: Lagerbil_Mitte: Y(k)(t+(-1))+Q(k)(t)+Y(k)(t)*(-1) == Q(k+1)(t+1).
-
OPL kcan not extract the expression: Produktionskapa: Q(k)(t) <= MAXANZW(k)(t).
I hope someone can help me! I'am thankful for every single advice!
Thanks!
Marco
#DecisionOptimization#OPLusingCPLEXOptimizer