Changeset 162 for trunk


Ignore:
Timestamp:
Sep 19, 2005 1:43:58 PM (15 years ago)
Author:
forrest
Message:

issecondslimit

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/CbcModel.cpp

    r161 r162  
    412412*/
    413413  status_ = 0 ;
     414  secondaryStatus_ = 0;
    414415  phase_=0;
    415416/*
     
    448449  { handler_->message(CBC_INFEAS,messages_)<< CoinMessageEol ;
    449450    status_ = 0 ;
     451    secondaryStatus_ = 1;
    450452    originalContinuousObjective_ = COIN_DBL_MAX;
    451453    return ; }
     
    12301232            << dblParam_[CbcAllowableFractionGap]*100.0
    12311233            << CoinMessageEol ;
     1234        secondaryStatus_ = 2;
    12321235          status_ = 0 ; }
    12331236        else
    12341237        if (isNodeLimitReached())
    12351238        { handler_->message(CBC_MAXNODES,messages_) << CoinMessageEol ;
     1239        secondaryStatus_ = 3;
    12361240          status_ = 1 ; }
    12371241        else
    12381242        if (totalTime >= dblParam_[CbcMaximumSeconds])
    12391243        { handler_->message(CBC_MAXTIME,messages_) << CoinMessageEol ;
     1244        secondaryStatus_ = 4;
    12401245          status_ = 1 ; }
    12411246        else
    12421247        if (eventHappened)
    12431248        { handler_->message(CBC_EVENT,messages_) << CoinMessageEol ;
     1249        secondaryStatus_ = 5;
    12441250          status_ = 5 ; }
    12451251        else
    12461252        { handler_->message(CBC_MAXSOLS,messages_) << CoinMessageEol ;
     1253        secondaryStatus_ = 6;
    12471254          status_ = 1 ; }
    12481255        break ; }
     
    15101517  // But set up so Jon Lee will be happy
    15111518  status_=-1;
     1519  secondaryStatus_ = -1;
    15121520  originalContinuousObjective_ = solver_->getObjValue()*solver_->getObjSense();
    15131521  delete [] continuousSolution_;
     
    15821590  numberIterations_(0),
    15831591  status_(-1),
     1592  secondaryStatus_(-1),
    15841593  numberIntegers_(0),
    15851594  numberRowsAtContinuous_(0),
     
    16691678  numberIterations_(0),
    16701679  status_(-1),
     1680  secondaryStatus_(-1),
    16711681  numberRowsAtContinuous_(0),
    16721682  maximumNumberCuts_(0),
     
    18481858  numberIterations_(rhs.numberIterations_),
    18491859  status_(rhs.status_),
     1860  secondaryStatus_(rhs.secondaryStatus_),
    18501861  specialOptions_(rhs.specialOptions_),
    18511862  subTreeModel_(rhs.subTreeModel_),
     
    20752086    numberIterations_ = rhs.numberIterations_;
    20762087    status_ = rhs.status_;
     2088    secondaryStatus_ = rhs.secondaryStatus_;
    20772089    specialOptions_ = rhs.specialOptions_;
    20782090    subTreeModel_ = rhs.subTreeModel_;
     
    22892301{
    22902302  return numberNodes_ >= intParam_[CbcMaxNumNode];
     2303}
     2304// Time limit reached?
     2305bool
     2306CbcModel::isSecondsLimitReached() const
     2307{
     2308  if (status_==1&&secondaryStatus_==4)
     2309    return true;
     2310  else
     2311    return false;
    22912312}
    22922313// Solution limit reached?
     
    50145035    <<CoinMessageEol;
    50155036    status_ = 0;
     5037    secondaryStatus_ = 1;
    50165038    delete newModel;
    50175039    return NULL;
     
    54015423  numberIterations_ = presolvedModel->numberIterations_;
    54025424  status_ = presolvedModel->status_;
     5425  secondaryStatus_ = presolvedModel->secondaryStatus_;
    54035426  synchronizeModel();
    54045427}
  • trunk/include/CbcModel.hpp

    r160 r162  
    618618    /// Node limit reached?
    619619    bool isNodeLimitReached() const;
     620    /// Time limit reached?
     621    bool isSecondsLimitReached() const;
    620622    /// Solution limit reached?
    621623    bool isSolutionLimitReached() const;
     
    13641366  /// Status of problem - 0 finished, 1 stopped, 2 difficulties
    13651367  int status_;
     1368  /** Secondary status of problem
     1369      -1 unset (status_ will also be -1)
     1370      0 search completed with solution
     1371      1 linear relaxation not feasible (or worse than cutoff)
     1372      2 stopped on gap
     1373      3 stopped on nodes
     1374      4 stopped on time
     1375      5 stopped on user event
     1376      6 stopped on solutions
     1377   */
     1378  int secondaryStatus_;
    13661379  /// Number of integers in problem
    13671380  int numberIntegers_;
Note: See TracChangeset for help on using the changeset viewer.