<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi,<br>
<br>
I'm working to customize my branching rules using a the <b>betterBranch</b>
method in a class derived from <b>CbcBranchDynamicDecision</b>.<br>
<br>
This method has the following signature:<br>
<b><font color="#000066"><tt>betterBranch(CbcBranchingObject
*thisOne,<br>
CbcBranchingObject *bestSoFar,<br>
double changeUp, int numInfUp,<br>
double changeDown, int numInfDown)<br>
</tt></font></b><br>
To decide which variable to branch I need to check:<br>
- fractional value which variables take in current LP solution;<br>
- variable names (some variables are more important than others
and I can check this by looking at their names.<br>
<br>
I think I succeed to check for their names with the following code:<br>
<b><tt><font color="#000066"> OsiSolverInterface *lp =
thisOne->model()->referenceSolver();<br>
CbcIntegerBranchingObject *ibo =
dynamic_cast<CbcIntegerBranchingObject *> (thisOne);<br>
if (ibo)<br>
{<br>
int idxInt = ibo->variable();<br>
int idxVar =
ibo->model()->integerVariable()[idxInt];<br>
// name is in lp->getColName(idxVar)<br>
</font></tt></b><br>
To check for the fractional value I though I could pick the value
in:<br>
<b><font color="#000066"><tt> lp->getColSolution()[idxVar]<br>
</tt></font></b><br>
But this value appears to be an integer value in many calls - I
though that only fractional variables where considered for <b>thisOne</b>
object.<br>
<br>
Is this the correct way to get the fractional value of the variable
???<br>
<br>
<pre class="moz-signature" cols="72">--
=============================================================
Haroldo Gambini Santos
Computing Department - Universidade Federal de Ouro Preto - UFOP
email: haroldo [at ] iceb.ufop.br
home/research page: <a class="moz-txt-link-abbreviated" href="http://www.decom.ufop.br/haroldo/">www.decom.ufop.br/haroldo/</a>
</pre>
</body>
</html>