Changeset 48 for trunk/CbcNode.cpp


Ignore:
Timestamp:
Dec 31, 2004 4:53:27 AM (16 years ago)
Author:
forrest
Message:

skip messages etc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CbcNode.cpp

    r44 r48  
    842842*/
    843843
    844 int CbcNode::chooseBranch (CbcModel *model, CbcNode *lastNode)
     844int CbcNode::chooseBranch (CbcModel *model, CbcNode *lastNode,int numberPassesLeft)
    845845
    846846{ if (lastNode)
     
    855855  const double * lower = solver->getColLower();
    856856  const double * upper = solver->getColUpper();
    857 
    858857  int anyAction=0;
    859858  double integerTolerance =
     
    10931092    }
    10941093  }
     1094  // If we have hit max time don't do strong branching
     1095  bool hitMaxTime = ( CoinCpuTime()-model->getDblParam(CbcModel::CbcStartSeconds) >
     1096                        model->getDblParam(CbcModel::CbcMaximumSeconds));
     1097  // also give up if we are looping round too much
     1098  if (hitMaxTime||numberPassesLeft<=0)
     1099    numberStrong=0;
    10951100/*
    10961101  Is strong branching enabled? If so, set up and do it. Otherwise, we'll
     
    11031108   
    11041109    bool solveAll=false; // set true to say look at all even if some fixed (experiment)
     1110    // worth trying if too many times
    11051111    // Save basis
    11061112    CoinWarmStart * ws = solver->getWarmStart();
     
    12131219        restoring the bounds.
    12141220*/
    1215     // If we have hit max time ignore fixing on one way
    1216     bool hitMaxTime = ( CoinCpuTime()-model->getDblParam(CbcModel::CbcStartSeconds) >
    1217                         model->getDblParam(CbcModel::CbcMaximumSeconds));
    12181221    for (i = 0 ; i < numberStrong ; i++)
    12191222    { double objectiveChange ;
     
    13641367        if(choice[i].downMovement<1.0e100) {
    13651368          // feasible - no action
    1366         } else if (!hitMaxTime) {
     1369        } else {
    13671370          // up feasible, down infeasible
    13681371          anyAction=-1;
     
    13751378      } else {
    13761379        if(choice[i].downMovement<1.0e100) {
    1377           if (!hitMaxTime) {
    1378             // down feasible, up infeasible
    1379             anyAction=-1;
    1380             if (!solveAll) {
    1381               choice[i].possibleBranch->way(-1);
    1382               choice[i].possibleBranch->branch();
    1383               break;
    1384             }
     1380          // down feasible, up infeasible
     1381          anyAction=-1;
     1382          if (!solveAll) {
     1383            choice[i].possibleBranch->way(-1);
     1384            choice[i].possibleBranch->branch();
     1385            break;
    13851386          }
    13861387        } else {
Note: See TracChangeset for help on using the changeset viewer.