Originally posted by: SystemAdmin
Thanks a lot, Daniel! I added the code you suggested before cplex.solve() and the model.xml file was generated. Then I inspected the xml file and the number of variables seems right: 394 (at least in the linearpart of the xml file). If
x and
y are two variables I defined, and in the objective function there are terms
x*x, y*y, x*y (as is the case in the objective expression I defined). Are they (+x*x, y*y, x*y+) also counted as variables? I am not sure about the number of constraints because I don't know the exact meaning of different IDs in the xml file. The skeleton of the xml file is attached as follows (the original file is too long to be copied and pasted here):
*<?xml version="1.0"?>
-<Root>
-<Modeler version="1.0a" name="resalloc">
-<objective sense="Minimize" Id="1">
-<numScalProd Id="2">
-<linearpart>
-<numLinearVar coef="0.283801693019633">
-<intVar name="number" Id="3">
<intDomain upperbound="3" lowerbound="1"/>
</intVar>
</numLinearVar>
........
numLinearVar coef="-0.0000946005643398777">
-<intVar name="freq_lvl" Id="396">
<intDomain upperbound="6" lowerbound="1"/>
</intVar>
</numLinearVar>
</linearpart>
-<nonlinearpart>
-<numExpr coef="1.0">
-<numQuadExpr Id="397">
-<numQuadExprTerm coef="0.0000473002821699389">
-<var1> <intVar RefId="4"/>
</var1>
-<var2>
<intVar RefId="4"/>
</var2>
</numQuadExprTerm>
.........
-<numQuadExprTerm coef="0.0000473002821699389">
-<var1>
<intVar RefId="396"/>
</var1>
-<var2>
<intVar RefId="396"/>
</var2>
</numQuadExprTerm>
</numQuadExpr>
</numExpr>
</nonlinearpart>
<constantpart> 0 </constantpart>
</numScalProd>
</objective>
-<range name="range" Id="398" upperbound="8" lowerbound="7">
-<expr>
-<numLinTerm Id="399">
-<linearpart>
-<numLinearVar coef="6">
<intVar RefId="3"/>
</numLinearVar>
-<numLinearVar coef="1">
<intVar RefId="4"/>
</numLinearVar>
</linearpart>
<constantpart> 0 </constantpart>
</numLinTerm>
</expr>
</range>
.............
-<range name="range" Id="790" upperbound="8" lowerbound="7">
-<expr>
-<numLinTerm Id="791">
-<linearpart>
-<numLinearVar coef="6">
<intVar RefId="395"/>
</numLinearVar>
-<numLinearVar coef="1">
<intVar RefId="396"/>
</numLinearVar>
</linearpart>
<constantpart> 0 </constantpart>
</numLinTerm>
</expr>
</range>
</Modeler>
</Root>*
I am lost now. How many variables and constraints are there actually? The range ID spans from 398 to 790 with a step of 2, i.e., 197 constraints, which is the number of constraints i thought there would be. However, the numLinTerm ID spans from 399 to 791 with the same step of 2, that makes another 197 'I-dunno-what-it-is'(constraint?). And what about the RefId?
This xml file does provide some info about the model i created tho. Hope the information is enough for u. I can post the whole xml file here if it's necessary for u to read more info from it.
Zillions of thanks!
#CPLEXOptimizers#DecisionOptimization