Ignore:
Timestamp:
Jun 8, 2005 12:13:14 PM (16 years ago)
Author:
forrest
Message:

dynamic branching stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CbcBranchDynamic.cpp

    r137 r147  
    273273  else
    274274    preferredWay=-1;
     275  // weight at 1.0 is max min
    275276#define WEIGHT_AFTER 0.8
     277#define WEIGHT_BEFORE 0.3
    276278  if (fabs(value-nearest)<=integerTolerance) {
    277279    return 0.0;
     
    281283    double minValue = CoinMin(downCost,upCost);
    282284    double maxValue = CoinMax(downCost,upCost);
    283     if (stateOfSearch==0) {
     285    if (stateOfSearch<=1||model_->currentNode()->depth()<=10) {
    284286      // no solution
    285       returnValue = 0.5*minValue + 0.5*maxValue;
     287      returnValue = WEIGHT_BEFORE*minValue + (1.0-WEIGHT_BEFORE)*maxValue;
    286288    } else {
    287289      // some solution
     
    681683  int betterWay=0;
    682684  double value=0.0;
    683   if (!stateOfSearch) {
     685  if (stateOfSearch<=1||thisOne->model()->currentNode()->depth()<=10) {
     686#if 0
    684687    if (!bestObject_) {
    685688      bestNumberUp_=INT_MAX;
     
    723726      value = CoinMin(numInfUp,numInfDown);
    724727    }
     728#else
     729    if (!bestObject_) {
     730      bestCriterion_=-1.0;
     731    }
     732    // got a solution
     733    double minValue = CoinMin(changeDown,changeUp);
     734    double maxValue = CoinMax(changeDown,changeUp);
     735    value = WEIGHT_BEFORE*minValue + (1.0-WEIGHT_BEFORE)*maxValue;
     736    if (value>bestCriterion_+1.0e-8) {
     737      if (changeUp<=changeDown) {
     738        betterWay=1;
     739      } else {
     740        betterWay=-1;
     741      }
     742    }
     743#endif
    725744  } else {
    726745    if (!bestObject_) {
Note: See TracChangeset for help on using the changeset viewer.