Originally posted by: WangZhengxu
Hi all,
I am using the OPL coding Mathematical Programming, then I find a confusing problem:
Please read the code first:
{string
} DRequests =
{
"SL1",
"SL2",
"SL3",
"SL4",
"SL5",
"SL6",
"SL7",
"SL8",
"SL9",
"SL10"
};
{string
} StorageLocations =
{
"DRequest1",
"DRequest2",
"DRequest3",
"DRequest4",
"DRequest5"
}; dvar
boolean x[DRequests][StorageLocations]; minimize sum(i in DRequests, j in StorageLocations)x[i][j]; subject to
{ forall(k in StorageLocations) sum(i in DRequests)x[i][k] ==1; forall(i in DRequests) sum(k in StorageLocations)x[i][k] == 1;
}
The CPLEX Studio says the decision variable x has no value, but actually, the
x[DRequest1][SL1]=1; x[DRequest2][SL2]=1;x[DRequest3][SL3]=1;x[DRequest4][SL4]=1;x[DRequest5][SL5]=1
could be a answer.
Do you know why? or where am I wrong?
#DecisionOptimization#MathematicalProgramming-General