当前位置: 首页>>代码示例>>C++>>正文


C++ SmartPtr::AddStringOption3方法代码示例

本文整理汇总了C++中ipopt::SmartPtr::AddStringOption3方法的典型用法代码示例。如果您正苦于以下问题:C++ SmartPtr::AddStringOption3方法的具体用法?C++ SmartPtr::AddStringOption3怎么用?C++ SmartPtr::AddStringOption3使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ipopt::SmartPtr的用法示例。


在下文中一共展示了SmartPtr::AddStringOption3方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: discarded

  /** Register OA feasibility checker  options.*/
  void
  OaFeasibilityChecker::registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions)
  {
    roptions->SetRegisteringCategory("Feasibility checker using OA cuts", RegisteredOptions::BonminCategory);
    roptions->AddStringOption2("feas_check_cut_types", "Choose the type of cuts generated when an integer feasible solution is found",
                               "outer-approx",
                               "outer-approx", "Generate a set of Outer Approximations cuts.",
                               "Benders", "Generate a single Benders cut.",
                               "If it seems too much memory is used should try Benders to use less");
    roptions->setOptionExtraInfo("feas_check_cut_types", 19);
    

    roptions->AddStringOption3("feas_check_discard_policy", "How cuts from feasibility checker are discarded",
                               "detect-cycles",
                               "detect-cycles", "Detect if a cycle occurs and only in this case force not to discard.",
                               "keep-all", "Force cuts from feasibility checker not to be discarded (memory hungry but sometimes better).",
                               "treated-as-normal", "Cuts from memory checker can be discarded as any other cuts (code may cycle then)",
                               "Normally to avoid cycle cuts from feasibility checker should not be discarded in the node where they are generated. "
                               "However Cbc sometimes does it if no care is taken which can lead to an infinite loop in Bonmin (usually on simple problems). "
                               "To avoid this one can instruct Cbc to never discard a cut but if we do that for all cuts it can lead to memory problems. "
                               "The default policy here is to detect cycles and only then impose to Cbc to keep the cut. "
                               "The two other alternative are to instruct Cbc to keep all cuts or to just ignore the problem and hope for the best");
    roptions->setOptionExtraInfo("feas_check_discard_policy", 19);

    roptions->AddLowerBoundedIntegerOption("generate_benders_after_so_many_oa", "Specify that after so many oa cuts have been generated Benders cuts should be generated instead.",
                                           0, 5000,
                                           "It seems that sometimes generating too many oa cuts slows down the optimization compared to Benders due to the size of the LP. "
                                           "With this option we specify that after so many OA cuts have been generated we should switch to Benders cuts.");
    roptions->setOptionExtraInfo("generate_benders_after_so_many_oa", 19);
  }
开发者ID:coin-or,项目名称:Bonmin,代码行数:31,代码来源:BonOaFeasChecker.cpp


注:本文中的ipopt::SmartPtr::AddStringOption3方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。