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

Last change on this file since 98 was 98, checked in by andreasw, 13 years ago

first version of BonChooseVariable? for Hessian-based strong branching; minor corrections

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