Dip  0.92.4
MILP_Param.h
Go to the documentation of this file.
1 //===========================================================================//
2 // This file is part of the Decomp Solver Framework. //
3 // //
4 // Decomp is distributed under the Common Public License as part of the //
5 // COIN-OR repository (http://www.coin-or.org). //
6 // //
7 // Authors: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com) //
8 // Ted Ralphs, Lehigh University (ted@lehigh.edu) //
9 // Jiadong Wang, Lehigh University (jiw408@lehigh.edu) //
10 // //
11 // Copyright (C) 2002-2019, Lehigh University, Matthew Galati, and Ted Ralphs//
12 // All Rights Reserved. //
13 //===========================================================================//
14 
15 #ifndef MILP_PARAM_INCLUDED
16 #define MILP_PARAM_INCLUDED
17 
18 //===========================================================================//
19 #include "UtilParameters.h"
20 
21 using namespace std;
22 
23 //===========================================================================//
24 class MILP_Param{
25 public:
26  int LogLevel;
27  int RandomSeed;
28  double RelaxPercent;
29  double BestKnownLB;
30  double BestKnownUB;
31  string DataDir;
32  string Instance;
33 
34 public:
35  void getSettings(UtilParameters & utilParam){
36  static const char * common = "MILP";
37  LogLevel = utilParam.GetSetting("LogLevel", 0, common);
38  RandomSeed = utilParam.GetSetting("RandomSeed", 1, common);
39  RelaxPercent = utilParam.GetSetting("RelaxPercent", 0.333, common);
40  BestKnownLB = utilParam.GetSetting("BestKnownLB", -1.e100, common);
41  BestKnownUB = utilParam.GetSetting("BestKnownUB", 1.e100, common);
42  DataDir = utilParam.GetSetting("DataDir", "", common);
43  Instance = utilParam.GetSetting("Instance", "", common);
44  }
45 
46  void dumpSettings(ostream * os = &cout){
47  static const char * common = "MILP";
48  (*os) << "\n=====================================================\n"
49  << "MILP_DECOMP PARAMETER SETTINGS \n";
50  (*os) << common << ": LogLevel : " << LogLevel << endl;
51  (*os) << common << ": RandomSeed : " << RandomSeed << endl;
52  (*os) << common << ": RelaxPercent: " << RelaxPercent << endl;
53  (*os) << common << ": BestKnownLB : " << BestKnownLB << endl;
54  (*os) << common << ": BestKnownUB : " << BestKnownUB << endl;
55  (*os) << common << ": DataDir : " << DataDir << endl;
56  (*os) << common << ": Instance : " << Instance << endl;
57  (*os) << "\n=====================================================\n";
58  }
59 
60 public:
62  LogLevel (0 ),
63  RandomSeed (1 ),
64  RelaxPercent(0.333 ),
65  BestKnownLB (-1e100),
66  BestKnownUB ( 1e100),
67  DataDir ("" ),
68  Instance ("" ) {};
70 };
71 
72 #endif
string GetSetting(const char *name, const char *defaultValue, const char *section=NULL)
void getSettings(UtilParameters &utilParam)
Definition: MILP_Param.h:35
void dumpSettings(ostream *os=&cout)
Definition: MILP_Param.h:46