I already put the Excel file in the same location of the project file. However it is still not working.
Here I attach the file.mod , file.data and also the Excel file to be checked if something wrong that i did in the coding.
Thank you. Regards.
file.mod:
{string} depot=...;
{string} customer=...;
{string} vehicle=...;
{string} node=...;
int N=card(customer);
float dist[node][node]=...;
float fcost[depot]=...;
float D[customer]=...;
float VC[vehicle]=...;
float VD[depot]=...;
dvar boolean x[node][node][vehicle];
dvar boolean z[depot];
dvar boolean y[depot][customer];
dvar float+ u[customer][vehicle];
dexpr float facility=sum(i in node, j in node:j!=i, k in vehicle)x[i][j][k]*dist[i][j];
dexpr float travel=sum(i in depot)fcost[i]*z[i];
dexpr float cost=facility + travel;
minimize cost;
subject to {
forall(j in customer) sum(i in node, k in vehicle)x[i][j][k]==1;
forall(k in vehicle) sum(i in depot, j in customer)x[i][j][k]<=1;
forall(k in vehicle) sum(i in node, j in customer:j!=i)D[j]*x[i][j][k]<=VC[k];
forall(i in node, k in vehicle) (sum(j in node)x[i][j][k])- (sum(j in node)x[j][i][k])==0;
forall(i in depot) sum(j in customer)D[j]*y[i][j]<=VD[i]*z[i];
forall(j in customer) sum(i in depot)y[i][j]==1;
forall(l in customer, j in customer, k in vehicle) u[l][k]-u[j][k]+N*x[l][j][k]<= N-1;
forall(i in depot, j in customer, k in vehicle) (sum(h in node)(x[i][h][k]+x[h][j][k]))-y[i][j]<=1;
}
file.mod
depot={"D1", "D2"};
customer={"C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "C10", "C11", "C12" };
node={"C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "C10", "C11", "C12", "D1", "D2" };
vehicle={"V1", "V2"};
SheetConnection excelsheet("Exceldata.xlsx");
dist from SheetRead(excelsheet, "dist");
fcost = [100, 100];
D= [20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20];
VC=[140, 140];
VD=[280, 280];