<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()-&gt;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>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CbcBranchingObject *bestSoFar,<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double changeUp, int numInfUp,<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double changeDown, int numInfDown)<br>
          </tt></font></b><br>
      To decide which variable to branch I need to check:<br>
      &nbsp; - fractional value which variables take in current LP solution;<br>
      &nbsp; - 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">&nbsp;&nbsp; OsiSolverInterface *lp =
            thisOne-&gt;model()-&gt;referenceSolver();<br>
            &nbsp;&nbsp; CbcIntegerBranchingObject *ibo =
            dynamic_cast&lt;CbcIntegerBranchingObject *&gt; (thisOne);<br>
            &nbsp;&nbsp; if (ibo)<br>
            &nbsp;&nbsp; {<br>
            &nbsp; &nbsp; &nbsp; int idxInt = ibo-&gt;variable();<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int idxVar =
            ibo-&gt;model()-&gt;integerVariable()[idxInt];<br>
            &nbsp; &nbsp; &nbsp; // name is in lp-&gt;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>&nbsp;&nbsp; lp-&gt;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>