Changeset 75 for trunk/CbcHeuristic.cpp


Ignore:
Timestamp:
Mar 4, 2005 1:19:11 PM (17 years ago)
Author:
forrest
Message:

add random rounding if zero cost

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CbcHeuristic.cpp

    r73 r75  
    195195      } else {
    196196        // won't be able to move unless we can grab another variable
    197         // just for now go down
    198         move = below-value;
     197        double randomNumber = CoinDrand48();
     198        // which way?
     199        if (randomNumber<0.5)
     200          move = below-value;
     201        else
     202          move = 1.0 -(value-below);
    199203      }
    200204      newValue += move;
Note: See TracChangeset for help on using the changeset viewer.