Ignore:
Timestamp:
Aug 10, 2007 12:18:20 PM (12 years ago)
Author:
forrest
Message:

event handling

File:
1 edited

Legend:

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

    r738 r741  
    691691  eventHappened_=false;
    692692  CbcEventHandler *eventHandler = getEventHandler() ;
     693  if (eventHandler)
     694    eventHandler->setModel(this);
    693695  // set up for probing
    694696  probingInfo_ = new CglTreeProbingInfo(solver_);
     
    11321134        }
    11331135      }
     1136      if (eventHandler) {
     1137        if (!eventHandler->event(CbcEventHandler::solution)) {
     1138          eventHappened_=true; // exit
     1139        }
     1140      }
    11341141    }
    11351142    delete [] newSolution ;
     
    11591166
    11601167      if (numberUnsatisfied)   {
    1161         feasible = solveWithCuts(cuts,maximumCutPassesAtRoot_,
    1162                                  NULL);
     1168        // User event
     1169        if (!eventHappened_)
     1170          feasible = solveWithCuts(cuts,maximumCutPassesAtRoot_,
     1171                                   NULL);
     1172        else
     1173          feasible=false;
    11631174      } else if (solverCharacteristics_->solutionAddsCuts()||
    11641175                 solverCharacteristics_->alwaysTryCutsAtRootNode()) {
     
    11901201    feasible = false;
    11911202  }
     1203  // User event
     1204  if (eventHappened_)
     1205    feasible=false;
    11921206/*
    11931207  We've taken the continuous relaxation as far as we can. Time to branch.
     
    32533267  lastHeuristic_ = NULL;
    32543268  if (rhs.eventHandler_)
    3255   { eventHandler_ = new CbcEventHandler(*rhs.eventHandler_) ; }
     3269    { eventHandler_ = rhs.eventHandler_->clone() ; }
    32563270  else
    32573271  { eventHandler_ = NULL ; }
     
    35743588      delete eventHandler_ ;
    35753589    if (rhs.eventHandler_)
    3576     { eventHandler_ = new CbcEventHandler(*rhs.eventHandler_) ; }
     3590      { eventHandler_ = rhs.eventHandler_->clone() ; }
    35773591    else
    35783592    { eventHandler_ = NULL ; }
Note: See TracChangeset for help on using the changeset viewer.