Ignore:
Timestamp:
Apr 27, 2009 10:53:07 PM (11 years ago)
Author:
pbonami
Message:

Strategy for Lp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Bonmin/src/Algorithms/OaGenerators/BonFpForMinlp.cpp

    r1422 r1424  
    3535    b.options()->GetEnumValue("milp_solver",ivalue,prefix);
    3636    if (ivalue <= 0) {//uses cbc
    37       //nothing to do?
     37      CbcStrategyDefault strategy;
     38      setStrategy(strategy);
    3839    }
    3940    else if (ivalue == 1) {
    40       int nodeS, nStrong, nTrust, mig, mir, probe, cover;
    41               b.options()->GetEnumValue("node_comparison",nodeS,prefix);
    42               b.options()->GetIntegerValue("number_strong_branch",nStrong, prefix);
    43               b.options()->GetIntegerValue("number_before_trust", nTrust, prefix);
    44               b.options()->GetIntegerValue("Gomory_cuts", mig, prefix);
    45 //            b.options()->GetIntegerValue("probing_cuts",probe, prefix);
    46               b.options()->GetIntegerValue("mir_cuts",mir, prefix);
    47               b.options()->GetIntegerValue("cover_cuts",cover,prefix);
    48               probe = 0;             
    49               //printf("Probing to 0\n");
    50               CbcStrategy * strategy =
    51                 new CbcOaStrategy(mig, probe, mir, cover, nTrust,
    52                     nStrong, nodeS, parameters_.cbcIntegerTolerance_, parameters_.subMilpLogLevel_);
    53               setStrategy(*strategy);
    54               delete strategy;
    55 
    56             }
    57             else if (ivalue == 2) {
    58         #ifdef COIN_HAS_CPX
    59               OsiCpxSolverInterface * cpxSolver = new OsiCpxSolverInterface;
    60               b.nonlinearSolver()->extractLinearRelaxation(*cpxSolver);
    61               assignLpInterface(cpxSolver);
    62         #else
    63               std::cerr << "You have set an option to use CPLEX as the milp\n"
    64               << "subsolver in oa decomposition. However, apparently\n"
    65               << "CPLEX is not configured to be used in bonmin.\n"
    66               << "See the manual for configuring CPLEX\n";
    67               throw -1;
    68         #endif
    69             }
    70 
    71             double oaTime;
    72             b.options()->GetNumericValue("time_limit",oaTime,prefix);
    73             parameter().localSearchNodeLimit_ = 1000000;
    74             parameter().maxLocalSearch_ = 100000;
    75             parameter().maxLocalSearchPerNode_ = 10000;
    76             parameter().maxLocalSearchTime_ =
    77             std::min(b.getDoubleParameter(BabSetupBase::MaxTime), oaTime);
    78   }
     41      CbcStrategyChooseCuts strategy(b, prefix);
     42      setStrategy(strategy);
     43    }
     44    else if (ivalue == 2) {
     45#ifdef COIN_HAS_CPX
     46      OsiCpxSolverInterface * cpxSolver = new OsiCpxSolverInterface;
     47      b.nonlinearSolver()->extractLinearRelaxation(*cpxSolver);
     48      assignLpInterface(cpxSolver);
     49#else
     50      std::cerr << "You have set an option to use CPLEX as the milp\n"
     51      << "subsolver in oa decomposition. However, apparently\n"
     52      << "CPLEX is not configured to be used in bonmin.\n"
     53      << "See the manual for configuring CPLEX\n";
     54      throw -1;
     55#endif
     56    }
     57
     58    double oaTime;
     59    b.options()->GetNumericValue("time_limit",oaTime,prefix);
     60    parameter().localSearchNodeLimit_ = 1000000;
     61    parameter().maxLocalSearch_ = 100000;
     62    parameter().maxLocalSearchPerNode_ = 10000;
     63    parameter().maxLocalSearchTime_ =
     64    std::min(b.getDoubleParameter(BabSetupBase::MaxTime), oaTime);
     65  }
     66
    7967  MinlpFeasPump::~MinlpFeasPump()
    8068  {}
Note: See TracChangeset for help on using the changeset viewer.