source: branches/devel/Bonmin/src/CbcBonmin/BonCbcParam.cpp @ 58

Last change on this file since 58 was 58, checked in by pbonami, 13 years ago

Finish renaming

  • Property svn:eol-style set to native
  • Property svn:keywords set to "Author Date Id Revision"
File size: 4.1 KB
Line 
1// (C) Copyright International Business Machines Corporation and Carnegie Mellon University 2006
2// All Rights Reserved.
3// This code is published under the Common Public License.
4//
5// Authors :
6// Laszlo Ladanyi, International Business Machines Corporation
7// Pierre Bonami, Carnegie Mellon University,
8//
9// Date : 03/15/2006
10
11#include "BonOsiTMINLPInterface.hpp"
12#include "BonCbcParam.hpp"
13
14namespace Bonmin {
15bool
16BonminCbcParam::extractParams(OsiTMINLPInterface * solver)
17{
18  bool success = true;
19
20  Ipopt::SmartPtr<Ipopt::OptionsList> Options = solver->retrieve_options();
21
22  //extract IpoptInterface special params
23  solver->extractInterfaceParams();
24
25  //log levels
26  success &= Options->GetIntegerValue("bb_log_level",bbLogLevel,"bonmin.");
27  success &= Options->GetIntegerValue("bb_log_interval",logInterval,"bonmin.");
28  success &= Options->GetIntegerValue("lp_log_level",lpLogLevel,"bonmin.");
29  success &= Options->GetIntegerValue("milp_log_level",milpLogLevel,"bonmin.");
30  success &= Options->GetIntegerValue("oa_log_level",oaLogLevel,"bonmin.");
31  success &= Options->GetNumericValue("oa_log_frequency",oaLogFrequency,"bonmin.");
32  success &= Options->GetIntegerValue("nlp_log_level",nlpLogLevel,"bonmin.");
33  //General options
34  success &= Options->GetEnumValue("algorithm",algo,"bonmin.");
35  success &= Options->GetNumericValue("time_limit", maxTime, "bonmin.");
36  success &= Options->GetIntegerValue("node_limit",maxNodes,"bonmin.");
37  success &= Options->GetNumericValue("integer_tolerance",intTol,"bonmin.");
38  success &= Options->GetNumericValue("allowable_gap",allowableGap,"bonmin.");
39  success &= Options->GetNumericValue("allowable_fraction_gap",allowableFractionGap,"bonmin.");
40  success &= Options->GetNumericValue("cutoff_decr",cutoffDecr,"bonmin.");
41  success &= Options->GetNumericValue("cutoff",cutoff,"bonmin.");
42
43  // Branch & bound setting
44  success &= Options->GetEnumValue("nodeselect_stra",nodeSelection,"bonmin.");
45  success &= Options->GetIntegerValue("number_strong_branch",numberStrong,"bonmin.");
46  success &= Options->GetIntegerValue("number_before_trust", minReliability,"bonmin.");
47
48  success &=  Options->GetEnumValue("sos_constraints",disableSos,"bonmin.");
49  // Robustness and non convex minlps
50  success &= Options->GetIntegerValue("max_consecutive_failures",
51      maxFailures,"bonmin.");
52  success &= Options->GetIntegerValue("max_consecutive_infeasible",
53      maxInfeasible,"bonmin.");
54  success &= Options->GetEnumValue("nlp_failure_behavior",failureBehavior,".bonmin");
55
56  // Hybrid options
57  success &= Options->GetIntegerValue("nlp_solve_frequency",nlpSolveFrequency,"bonmin.");
58  success &= Options->GetNumericValue("oa_dec_time_limit",oaDecMaxTime,"bonmin.");
59  success &= Options->GetIntegerValue("Gomory_cuts", migFreq,"bonmin.");
60  success &= Options->GetIntegerValue("probing_cuts",probFreq,"bonmin.");
61  success &= Options->GetIntegerValue("mir_cuts",mirFreq,"bonmin.");
62  success &= Options->GetIntegerValue("cover_cuts",coverFreq,"bonmin.");
63
64  // milp subsolver options
65  success &= Options->GetEnumValue("milp_subsolver",milpSubSolver,"bonmin.");
66  success &= Options->GetEnumValue("nodeselect_stra",milpSubSolver_nodeSelection,"milp_sub.");
67  success &= Options->GetIntegerValue("number_strong_branch",milpSubSolver_numberStrong,"milp_sub.");
68  success &= Options->GetIntegerValue("number_before_trust", milpSubSolver_minReliability,"milp_sub.");
69  success &= Options->GetIntegerValue("Gomory_cuts", milpSubSolver_migFreq,"milp_sub.");
70  success &= Options->GetIntegerValue("probing_cuts",milpSubSolver_probFreq,"milp_sub.");
71  success &= Options->GetIntegerValue("mir_cuts",milpSubSolver_mirFreq,"milp_sub.");
72  success &= Options->GetIntegerValue("cover_cuts",milpSubSolver_coverFreq,"milp_sub.");
73
74  //Preset default for algorithm
75  if(algo==0)//B-BB
76  {
77    minReliability=0;
78    numberStrong=0;
79  }
80  else if (algo==1)//B-OA
81  {
82    oaDecMaxTime = DBL_MAX;
83    nlpSolveFrequency = 0;
84    bbLogLevel = 0;
85  }
86  else if (algo==2) {
87    oaDecMaxTime = 0;
88    nlpSolveFrequency = 0;
89    migFreq = 0;
90    probFreq = 0;
91    mirFreq = 0;
92    coverFreq = 0;
93  }
94  else if (algo==3)//Nothing to do
95  {
96  }
97
98  return success;
99}
100}
Note: See TracBrowser for help on using the repository browser.