<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Haroldo,<br>
<br>
Solution changes because of stuff like strong branching.<br>
<br>
Look at model()->testSolution()[idxVar]<br>
<br>
<br>
John Forrest<br>
<br>
On 07/01/12 14:12, Haroldo Gambini Santos wrote:
<blockquote cite="mid:4F0852BD.4030109@gmail.com" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
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 moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.decom.ufop.br/haroldo/">www.decom.ufop.br/haroldo/</a>
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Cbc mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Cbc@list.coin-or.org">Cbc@list.coin-or.org</a>
<a class="moz-txt-link-freetext" href="http://list.coin-or.org/mailman/listinfo/cbc">http://list.coin-or.org/mailman/listinfo/cbc</a>
</pre>
</blockquote>
<br>
</body>
</html>