Ignore:
Timestamp:
Apr 30, 2007 2:01:34 PM (12 years ago)
Author:
pbonami
Message:

Transmit time limit to Ipopt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/0.1/Bonmin/src/CbcBonmin/CbcBonmin.cpp

    r470 r526  
    6969}
    7070
    71 
     71double GlobalTimeEnd;
    7272/** Constructor.*/
    7373BonminBB::BonminBB():
     
    9696  OsiSolverInterface * si;
    9797
     98  GlobalTimeEnd = CoinCpuTime() + par.maxTime;
    9899
    99100  nlpSolver.messageHandler()->setLogLevel(par.nlpLogLevel);
     
    401402  CbcBranchUserDecision branch;
    402403  model.setBranchingMethod(&branch);
    403 
     404  TMINLP::SolverReturn status;
     405
     406  if(CoinCpuTime() > GlobalTimeEnd){
     407    model.findIntegers(true);
     408    status = TMINLP::LIMIT_EXCEEDED;
     409    mipStatus_ = NoSolutionKnown;
     410  }
     411  else {
    404412  //Get the time and start.
    405413  model.initialSolve();
    406 
    407414  continuousRelaxation_ =model.solver()->getObjValue();
    408415  if(par.algo == 0)//Set warm start point for Ipopt
     
    465472    CoinCopyN(model.bestSolution(), nlpSolver.getNumCols(), bestSolution_);
    466473  }
    467   TMINLP::SolverReturn status;
    468474  if(model.status()==0) {
    469475    if(bestSolution_){
     
    485491  else if (model.status()==2){
    486492    status = TMINLP::MINLP_ERROR;
     493  }
    487494  }
    488495
Note: See TracChangeset for help on using the changeset viewer.