Originally posted by: cgaray
Hello,
I am using the CPLEX MATLAB API and I am running an analysis that requires a change in the objective function coefficients after each iteration. Ideally, I'd like to use the previous solution from this MILP problem as a start for the next solution. I am also changing the bound on one of the rows after each iteration. The problem here is that after I make these changes to an existing problem, it seems that CPLEX no longer recognizes the existence of the objective function. After invoking cplex.solve() on the instance of Cplex containing the modified model (and after the initial problem was successfully solved) I get the following error:
Error using cplexlink123 No Cplex.Model.obj found Error in C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\cplex\matlab\x64_win64\@Cplex\Cplex.p>Cplex.solve (line 1474) Error in C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\cplex\matlab\x64_win64\@Cplex\Cplex.p>Cplex.subsref (line 3716)
The following is cplex.Model structure, showing that the objective function is indeed present:
K>> cplex.Model ans = sense:
'minimization' obj: [2284x1
double] lb: [2284x1
double] ub: [2284x1
double] A: [2496x2284
double] lhs: [2496x1
double] rhs: [2496x1
double] name:
'shlomi' ctype: [2284x1
char] rowname: [2496x7
char] colname: [2284x5
char]
Is there a way to modify the model so that I don't have to create a new instance of Cplex each time?
Thanks,
Chris
#CPLEXOptimizers#DecisionOptimization