Changeset 1040


Ignore:
Timestamp:
Aug 5, 2008 5:01:39 AM (11 years ago)
Author:
forrest
Message:

more iterations at root

Location:
trunk/Cbc/src
Files:
2 edited

Legend:

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

    r1013 r1040  
    2727  maxIterations_ = 100;
    2828  maxSimplexIterations_ = 10000;
     29  maxSimplexIterationsAtRoot_ = 1000000;
    2930  maxTime_ = 600;
    3031}
     
    4849  maxIterations_ = 100;
    4950  maxSimplexIterations_ = 10000;
     51  maxSimplexIterationsAtRoot_ = 1000000;
    5052  maxTime_ = 600;
    5153}
     
    9193  maxIterations_(rhs.maxIterations_),
    9294  maxSimplexIterations_(rhs.maxSimplexIterations_),
     95  maxSimplexIterationsAtRoot_(rhs.maxSimplexIterationsAtRoot_),
    9396  maxTime_(rhs.maxTime_)
    9497{
     
    114117    maxIterations_ = rhs.maxIterations_;
    115118    maxSimplexIterations_ = rhs.maxSimplexIterations_;
     119    maxSimplexIterationsAtRoot_ = rhs.maxSimplexIterationsAtRoot_;
    116120    maxTime_ = rhs.maxTime_;
    117121    delete [] downLocks_;
     
    207211  double time1 = CoinCpuTime();
    208212  int numberSimplexIterations=0;
     213  int maxSimplexIterations= (model_->getNodeCount()) ? maxSimplexIterations_
     214    : maxSimplexIterationsAtRoot_;
    209215
    210216  OsiSolverInterface * solver = model_->solver()->clone();
     
    502508
    503509    numberSimplexIterations+=solver->getIterationCount();
    504     if(numberSimplexIterations > maxSimplexIterations_) {
     510    if(numberSimplexIterations > maxSimplexIterations) {
    505511#ifdef DIVE_DEBUG
    506512      reasonToStop = 4;
    507513#endif
    508514      // also switch off
    509       printf("switching off diving as too many iterations\n");
     515#ifdef CLP_INVESTIGATE
     516      printf("switching off diving as too many iterations %d, %d allowed\n",
     517             numberSimplexIterations,maxSimplexIterations);
     518#endif
    510519      when_=0;
    511520      break;
     
    586595           <<", returnCode = "<<returnCode
    587596           <<", reasonToStop = "<<reasonToStop
     597           <<", simplexIts = "<<numberSimplexIterations
    588598           <<", iterations = "<<iteration<<std::endl;
    589599#endif
  • trunk/Cbc/src/CbcHeuristicDive.hpp

    r1013 r1040  
    6666  { maxIterations_ = value; }
    6767
     68  /// Set maximum number of simplex iterations
     69  void setMaxSimplexIterations(int value)
     70  { maxSimplexIterations_ = value; }
     71
     72  /// Set maximum number of simplex iterations at root node
     73  void setMaxSimplexIterationsAtRoot(int value)
     74  { maxSimplexIterationsAtRoot_ = value; }
     75
    6876  /// Set maximum time allowed
    6977  void setMaxTime(double value)
     
    118126  int maxSimplexIterations_;
    119127
     128  // Maximum number of simplex iterations at root node
     129  int maxSimplexIterationsAtRoot_;
     130
    120131  // Maximum time allowed
    121132  double maxTime_;
Note: See TracChangeset for help on using the changeset viewer.