예제 #1
0
  OaDecompositionBase::OaDecompositionBase(BabSetupBase &b, bool leaveSiUnchanged,
      bool reassignLpsolver):
      CglCutGenerator(),
      nlp_(b.nonlinearSolver()),
      s_(&b),
      lp_(NULL),
      objects_(NULL),
      nObjects_(0),
      nLocalSearch_(0),
      handler_(NULL),
      leaveSiUnchanged_(leaveSiUnchanged),
      reassignLpsolver_(reassignLpsolver),
      timeBegin_(0),
      numSols_(0),
      parameters_(),
      currentNodeNumber_(-1)
  {
    handler_ = new CoinMessageHandler();
    int logLevel;
    b.options()->GetIntegerValue("oa_log_level",logLevel,b.prefix());
    b.options()->GetNumericValue("oa_log_frequency",parameters_.logFrequency_,b.prefix());
    b.options()->GetNumericValue("allowable_fraction_gap", parameters_.gap_tol_, b.prefix());
    handler_ -> setLogLevel(logLevel);
    b.options()->GetIntegerValue("solution_limit", parameters_.maxSols_,b.prefix());

    messages_ = OaMessages();
    timeBegin_ = CoinCpuTime();
    b.options()->GetIntegerValue("milp_log_level",parameters_.subMilpLogLevel_,b.prefix());
    b.options()->GetNumericValue("cutoff_decr",parameters_.cbcCutoffIncrement_,b.prefix());
    b.options()->GetNumericValue("integer_tolerance",parameters_.cbcIntegerTolerance_,b.prefix());
    int ivalue;
    b.options()->GetEnumValue("add_only_violated_oa", ivalue,b.prefix());
    parameters_.addOnlyViolated_ = ivalue;
    b.options()->GetEnumValue("oa_cuts_scope", ivalue,b.prefix());
    parameters_.global_ = ivalue;
}
예제 #2
0
  void LinearCutsGenerator::initialize(BabSetupBase & s){
    assert(dynamic_cast<TMINLP2TNLPQuadCuts *> (s.nonlinearSolver()->problem()));
    int freq;
    s.options()->GetIntegerValue("Gomory_cuts", freq,"bonmin.");
    if (freq) {
      Coin::SmartPtr<CuttingMethod> cg = new CuttingMethod;
      cg->frequency = freq;
      CglGomory * gom = new CglGomory;
      cg->cgl = gom;
      gom->setLimitAtRoot(512);
      gom->setLimit(50);
      cg->id = "Mixed Integer Gomory";
      methods_.push_back(cg);
    }

    s.options()->GetIntegerValue("mir_cuts",freq,"bonmin.");
    if (freq) {
      Coin::SmartPtr<CuttingMethod> cg = new CuttingMethod;
      cg->frequency = freq;
      CglMixedIntegerRounding2 * mir = new CglMixedIntegerRounding2;
      cg->cgl = mir;
      cg->id = "Mixed Integer Rounding";
      methods_.push_back(cg);


    }
    s.options()->GetIntegerValue("2mir_cuts",freq,"bonmin.");
    if (freq) {
      Coin::SmartPtr<CuttingMethod> cg = new CuttingMethod;
      cg->frequency = freq;
      CglTwomir * mir2 = new CglTwomir;
      cg->cgl = mir2;
      cg->id = "2-MIR";
      methods_.push_back(cg);
    }
    s.options()->GetIntegerValue("cover_cuts",freq,"bonmin.");
    if (freq) {
      Coin::SmartPtr<CuttingMethod> cg = new CuttingMethod;
      cg->frequency = freq;
      CglKnapsackCover * cover = new CglKnapsackCover;
      cg->cgl = cover;
      cg->id = "Cover";
      methods_.push_back(cg);
    }

    s.options()->GetIntegerValue("clique_cuts",freq,"bonmin.");
    if (freq) {
      Coin::SmartPtr<CuttingMethod> cg = new CuttingMethod;
      cg->frequency = freq;
      CglClique * clique = new CglClique;
      clique->setStarCliqueReport(false);
      clique->setRowCliqueReport(false);
      clique->setMinViolation(0.1);

      cg->cgl = clique;
      cg->id = "Clique";
      methods_.push_back(cg);
    }
    s.options()->GetIntegerValue("flow_cover_cuts",freq,"bonmin.");
    if (freq) {
      Coin::SmartPtr<CuttingMethod> cg = new CuttingMethod;
      cg->frequency = freq;
      CglFlowCover * flow = new CglFlowCover;
      cg->cgl = flow;
      cg->id = "Flow Covers";
      methods_.push_back(cg);
    }
    s.options()->GetIntegerValue("lift_and_project_cuts",freq,"bonmin.");
    if (freq) {
      Coin::SmartPtr<CuttingMethod> cg = new CuttingMethod;
      cg->frequency = freq;
      CglLandP * landp = new CglLandP;
      cg->cgl = landp;
      cg->id = "Lift-and-Project";
      methods_.push_back(cg);
    }
    s.options()->GetIntegerValue("reduce_and_split_cuts",freq,"bonmin.");
    if (freq) {
      Coin::SmartPtr<CuttingMethod> cg = new CuttingMethod;
      cg->frequency = freq;
      CglRedSplit * rands = new CglRedSplit;
      cg->cgl = rands;
      cg->id = "Reduce-and-Split";
      methods_.push_back(cg);
    }
  }