Originally posted by: lyl523
Hi, my model can run use the small data from the excel (D_average4c1), but when I increase the number of my data from the excel(D_average4c4), the cplex can run for a minutes, then come across the error:c0000005 EXCEPTION_ACCESS_VIOLATION
my model and data :
//import data;
int nbWarehouses = ...; //j
range warehouse = 1..nbWarehouses;
int nbDemands = ...;// i
range demand = 1..nbDemands;
int nbInstance = ...;// k
range instance = 1..nbInstance;
int nbType = ...; //l
range type = 1..nbType;
int D_average1[demand][instance]=...;
int D_average2[demand][instance]=...;
int D_average3[demand][instance]=...;
float P[instance] = ...;
float T[demand][warehouse]=...;
int Q = ...;
int t1 = ...;
int N = ...;
//read the data to the D
int D[demand][instance][type];
execute{
for(var i in demand){
for (var k in instance){
D[i][k][1]=D_average1[i][k];
D[i][k][2]=D_average2[i][k];
D[i][k][3]=D_average3[i][k];
}
}
}
// decision variables
dvar float+ x[demand][warehouse][instance][type] in 0..maxint;
dvar float+ w[demand][instance][type] in 0..maxint;
dvar float+ q[warehouse][type] in 0..maxint;
dvar int y[warehouse] in 0..1;
//marget
dexpr float shipping_obj = sum(k in instance) (P[k]*((sum(i in demand, l in type) w[i,k,l]*t1
+ sum(i in demand,j in warehouse,k in instance,l in type) x[i,j,k,l]*T[i,j])/(sum(i in demand, l in type) D[i,k,l])));
minimize shipping_obj;
subject to {
constraints1:
forall(i in demand, k in instance, l in type){
sum(j in warehouse) x[i,j,k,l] + w[i,k,l] >= D[i,k,l];
w[i,k,l] <= D[i,k,l];
//w[i,k,l] <= sum(j in warehouse) x[i,j,k,l];
}
constraints2:
forall(j in warehouse, k in instance, l in type){
sum(i in demand) x[i,j,k,l] <= q[j,l];
}
constraints3:
forall(j in warehouse, l in type){
q[j,l] <= Q*y[j];
}
constraints5:
sum(j in warehouse, l in type) q[j,l] <= Q ;
constraints6:
sum(j in warehouse) y[j] <= N ;
};
nbInstance = 230;
nbType = 3;
nbWarehouses = 11;
nbDemands = 31;
Q = 10000000;
t1 = 336;
N = 6;
SheetConnection sheet("D_average4c1.xlsx");
D_average1 from SheetRead(sheet,"'item1'!A1:HV31");
D_average2 from SheetRead(sheet,"'item2'!A1:HV31");
D_average3 from SheetRead(sheet,"'item3'!A1:HV31");
P from SheetRead(sheet,"'P'!A1:HV1");
T from SheetRead(sheet,"'T'!A1:K31");
/*test the D_average4c4.xlsx
nbInstance = 230;
nbType = 3;
nbWarehouses = 31;
nbDemands = 155;
Q = 10000000;
t1 = 336;
N = 24;
SheetConnection sheet("D_average4c4.xlsx");
D_average1 from SheetRead(sheet,"'item1'!A1:HV155");
D_average2 from SheetRead(sheet,"'item2'!A1:HV155");
D_average3 from SheetRead(sheet,"'item3'!A1:HV155");
P from SheetRead(sheet,"'P'!A1:HV1");
T from SheetRead(sheet,"'T'!A1:AE155");
*/
I cannot find the specific error, and I cannot understand the meaning of " c0000005 EXCEPTION_ACCESS_VIOLATION",my projects are all in the attachments.
#DecisionOptimization#OPLusingCPLEXOptimizer