Changeset 1216


Ignore:
Timestamp:
Aug 25, 2009 12:05:56 PM (10 years ago)
Author:
forrest
Message:

try and improve max time

Location:
trunk/Cbc/src
Files:
2 edited

Legend:

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

    r1212 r1216  
    1513715137  double totalTime = getCurrentSeconds() ;
    1513815138  double maxSeconds = getMaximumSeconds();
    15139   if (totalTime>=maxSeconds)
    15140     return true;
    15141   if (!parentModel_) {
    15142     return false;
    15143   } else {
     15139  bool hitMaxTime= (totalTime>=maxSeconds);
     15140  if (parentModel_&&!hitMaxTime) {
     15141    // In a sub tree so need to add both times
    1514415142    totalTime += parentModel_->getCurrentSeconds();
    1514515143    maxSeconds=parentModel_->getMaximumSeconds();
    15146     return (totalTime>=maxSeconds);
    15147   }
     15144    hitMaxTime = (totalTime>=maxSeconds);
     15145  }
     15146  if (hitMaxTime) {
     15147    // Set eventHappened_ so will by-pass as much stuff as possible
     15148    eventHappened_=true;
     15149  }
     15150  return hitMaxTime;
    1514815151}
    1514915152// Check original model before it gets messed up
  • trunk/Cbc/src/CbcModel.hpp

    r1212 r1216  
    22852285  bool stoppedOnGap_;
    22862286  /// Whether event happened
    2287   bool eventHappened_;
     2287  mutable bool eventHappened_;
    22882288  /// Number of long strong goes
    22892289  int numberLongStrong_;
Note: See TracChangeset for help on using the changeset viewer.