Originally posted by: SystemAdmin
I find the example in DOCS:
here.
Well,in my project, the vars declarations are in .mod file only and I import them using :
IloOplRunConfiguration rc0 = oplF.createOplRunConfiguration(DATADIR
+ "/mod_v1.mod", DATADIR + "/data_v1_2.dat");//The model definition,specify the data source for the model
Now, i want to print each solutions,like:
while(cp.next()){
...
IloOplElement K = oplModel.getElement("K");//取出解中的K值oplModel=rc0.getOplModel()
double KNum = K.asNum();//取出解中的K值
newK=Double.toString(KNum);//取出解中的K值
...
System.out.println(newK);
}
The problem is: value of "newK" is always same as the first solution that cp has found.
Does anyone familiar with this problem?
#CPLEXOptimizers#DecisionOptimization