Dip  0.92.4
ATM_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 ATM_PARAM_INCLUDED
16 #define ATM_PARAM_INCLUDED
17 
18 //===========================================================================//
19 #include "UtilParameters.h"
20 
21 using namespace std;
22 
23 //===========================================================================//
30 //===========================================================================//
31 class ATM_Param {
32 public:
33  int LogLevel; //application log level
34  string DataDir; //data directory
35  string DataAtm; //data file (atms)
36  string DataDate; //data file (dates)
37  string DataAtmDate; //data file (atms x dates)
38  int NumSteps; //number of steps for discretization of NLP
39  bool UseTightModel; //use tighter formulation of z=xy
40  string ModelNameCore; //name of model core
41  string ModelNameRelax; //name of model relax
42  string ModelNameRelaxNest;//name of nested model relax
43 
44 public:
45  void getSettings(UtilParameters & utilParam){
46  static const char * common = "ATM";
47  LogLevel = utilParam.GetSetting("LogLevel", 0, common);
48  DataDir = utilParam.GetSetting("DataDir", "", common);
49  DataAtm = utilParam.GetSetting("DataAtm", "", common);
50  DataDate = utilParam.GetSetting("DataDate", "", common);
51  DataAtmDate = utilParam.GetSetting("DataAtmDate", "", common);
52  NumSteps = utilParam.GetSetting("NumSteps", 10, common);
53  UseTightModel = utilParam.GetSetting("UseTightModel", true, common);
54  ModelNameCore = utilParam.GetSetting("ModelNameCore", "", common);
55  ModelNameRelax = utilParam.GetSetting("ModelNameRelax", "", common);
56  ModelNameRelaxNest
57  = utilParam.GetSetting("ModelNameRelaxNest", "", common);
58  }
59 
60  void dumpSettings(ostream * os = &cout){
61  static const char * common = "ATM";
62  (*os) << "\n=====================================================\n"
63  << "ATM_DECOMP PARAMETER SETTINGS \n";
64  (*os) << common << ": LogLevel : " << LogLevel << endl;
65  (*os) << common << ": DataDir : " << DataDir << endl;
66  (*os) << common << ": DataAtm : " << DataAtm << endl;
67  (*os) << common << ": DataDate : " << DataDate << endl;
68  (*os) << common << ": DataAtmDate : " << DataAtmDate << endl;
69  (*os) << common << ": NumSteps : " << NumSteps << endl;
70  (*os) << common << ": UseTightModel : " << UseTightModel << endl;
71  (*os) << common << ": ModelNameCore : " << ModelNameCore << endl;
72  (*os) << common << ": ModelNameRelax : " << ModelNameRelax << endl;
73  (*os) << common << ": ModelNameRelaxNest: " << ModelNameRelaxNest<< endl;
74  (*os) << "=====================================================\n";
75  }
76 
77 public:
79  LogLevel (0),
80  DataDir (""),
81  DataAtm (""),
82  DataDate (""),
83  DataAtmDate (""),
84  NumSteps (0),
85  UseTightModel (true),
86  ModelNameCore (""),
87  ModelNameRelax (""),
88  ModelNameRelaxNest(""){};
89  ~ATM_Param() {};
90 };
91 
92 #endif
string DataDir
Definition: ATM_Param.h:34
string GetSetting(const char *name, const char *defaultValue, const char *section=NULL)
int LogLevel
Definition: ATM_Param.h:33
string ModelNameCore
Definition: ATM_Param.h:40
void dumpSettings(ostream *os=&cout)
Definition: ATM_Param.h:60
bool UseTightModel
Definition: ATM_Param.h:39
ATM_Param()
Definition: ATM_Param.h:78
string ModelNameRelaxNest
Definition: ATM_Param.h:42
~ATM_Param()
Definition: ATM_Param.h:89
int NumSteps
Definition: ATM_Param.h:38
string DataAtmDate
Definition: ATM_Param.h:37
string DataDate
Definition: ATM_Param.h:36
void getSettings(UtilParameters &utilParam)
Definition: ATM_Param.h:45
string DataAtm
Definition: ATM_Param.h:35
string ModelNameRelax
Definition: ATM_Param.h:41