Ignore:
Timestamp:
Sep 3, 2007 12:24:04 PM (12 years ago)
Author:
forrest
Message:

to stop heuristics faster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcHeuristicFPump.cpp

    r774 r776  
    264264  double time1 = CoinCpuTime();
    265265  model_->solver()->resolve();
     266  if (!model_->solver()->isProvenOptimal()) {
     267    // presumably max time or some such
     268    return 0;
     269  }
    266270  if (cutoff<1.0e50&&false) {
    267271    // Fix on djs
     
    286290  double * firstPerturbedObjective = NULL;
    287291  double * firstPerturbedSolution = NULL;
    288   assert (model_->solver()->isProvenOptimal());
    289292  if (when_>=11&&when_<=15) {
    290293    fixInternal = when_ >11&&when_<15;
     
    364367      solver->resolve();
    365368      solver->setHintParam(OsiDoDualInResolve,takeHint,strength);
     369      if (!solver->isProvenOptimal()) {
     370        // presumably max time or some such
     371        exitAll=true;
     372        break;
     373      }
    366374    }
    367375    solver->setDblParam(OsiDualObjectiveLimit,1.0e50);
     
    369377    // Solver may not be feasible
    370378    if (!solver->isProvenOptimal()) {
     379      exitAll=true;
    371380      break;
    372381    }
     
    479488              returnCode = smallBranchAndBound(solver,numberNodes_,newSolution,newSolutionValue,
    480489                                               solutionValue,"CbcHeuristicFpump");
    481               if (returnCode<0)
    482                 returnCode=0; // returned on size
     490              if (returnCode<0) {
     491                if (returnCode==-2)
     492                  exitAll=true;
     493                returnCode=0; // returned on size or event
     494              }
    483495              if ((returnCode&2)!=0) {
    484496                // could add cut
     
    690702          }
    691703          solver->resolve();
    692           assert (solver->isProvenOptimal());
     704          if (!solver->isProvenOptimal()) {
     705            // presumably max time or some such
     706            exitAll=true;
     707            break;
     708          }
    693709          for (i=0;i<numberIntegers;i++) {
    694710            int iColumn = integerVariable[i];
     
    770786          }
    771787          solver->resolve();
     788          if (!solver->isProvenOptimal()) {
     789            // presumably max time or some such
     790            exitAll=true;
     791            break;
     792          }
    772793          if (numberTries==1&&numberPasses==1&&false) {
    773794            // save basis
     
    792813          }
    793814#endif
    794           assert (solver->isProvenOptimal());
     815          if (!solver->isProvenOptimal()) {
     816            // presumably max time or some such
     817            exitAll=true;
     818            break;
     819          }
    795820          // in case very dubious solver
    796821          lower = solver->getColLower();
     
    862887          delete [] obj;
    863888          solver2->resolve();
    864           assert (solver2->isProvenOptimal());
     889          if (!solver2->isProvenOptimal()) {
     890            // presumably max time or some such
     891            exitAll=true;
     892            break;
     893          }
     894          //assert (solver2->isProvenOptimal());
    865895          if (nAdd) {
    866896            solver->setColSolution(solver2->getColSolution());
     
    9711001      if (!newSolver->isProvenOptimal()) {
    9721002        //newSolver->writeMps("bad.mps");
    973         assert (newSolver->isProvenOptimal());
     1003        //assert (newSolver->isProvenOptimal());
     1004        exitAll=true;
    9741005        break;
    9751006      }
     
    9861017      returnCode = smallBranchAndBound(newSolver,numberNodes_,newSolution,newSolutionValue,
    9871018                                       cutoff,"CbcHeuristicLocalAfterFPump");
    988       if (returnCode<0)
    989         returnCode=0; // returned on size - could try changing
     1019      if (returnCode<0) {
     1020        if (returnCode==-2)
     1021          exitAll=true;
     1022        returnCode=0; // returned on size (or event) - could try changing
     1023      }
    9901024      if ((returnCode&2)!=0) {
    9911025        // could add cut
     
    10281062          } else {
    10291063            //newSolver->writeMps("bad3.mps");
     1064            exitAll=true;
     1065            break;
    10301066          }
    10311067        }
Note: See TracChangeset for help on using the changeset viewer.