Originally posted by: abhzap
Hi Paul,
Thank you for the reply. I checked and it seems the IloConversion object is being added. For e.g. the code below
//converting the X variables
for ( Map.Entry<MpVarX, IloNumVar> var : usedVarX.entrySet() ) {
master_problem.add(master_problem.conversion(var.getValue(), IloNumVarType.Int));
IloConversion convObj = master_problem.conversion(var.getValue(), IloNumVarType.Int);
master_problem.add(convObj);
}
gives the error -> CPLEX Error: multiple type conversions on a variable' caught; so the IloCoversion object is being added to the model.
Also, when write the solution using : master_problem.writeSolution("jsol"); The information included there actually shows the model is solved as an MIP. A part of the information is shown below
<?xml version = "1.0" standalone="yes"?>
<CPLEXSolution version="1.2">
<header
problemName="ilog.cplex"
solutionName="incumbent"
solutionIndex="-1"
objectiveValue="7000"
solutionTypeValue="3"
solutionTypeString="primal"
solutionStatusValue="101"
solutionStatusString="integer optimal solution"
solutionMethodString="mip"
primalFeasible="1"
dualFeasible="1"
MIPNodes="0"
MIPIterations="0"
writeLevel="1"/>
<quality
epInt="1e-05"
epRHS="1e-06"
maxIntInfeas="1.00000010050394e-07"
maxPrimalInfeas="0"
maxX="1"
maxSlack="9999998"/>
The solution is however still like below:
X_1 = 1.0
X_2 = 1.00000010000001E-7
X_3 = 1.00000010000001E-7
X_4 = 1.00000010000001E-7
X_5 = 1.00000010000001E-7
Y_1 = 1.00000010000001E-7
Y_2 = 1.00000010000001E-7
Y_3 = 1.0
Y_4 = 0.99999989999999
Y_5 = 0.99999989999999
#CPLEXOptimizers#DecisionOptimization