Dip  0.92.4
DecompParam.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 // Author: Matthew Galati, Lehigh University //
8 // //
9 // Copyright (C) 2002-2007, Lehigh University, Matthew Galati, and Ted Ralphs//
10 // All Rights Reserved. //
11 //===========================================================================//
12 
13 #ifndef DECOMP_PARAM_INCLUDED
14 #define DECOMP_PARAM_INCLUDED
15 
16 #include "UtilParameters.h"
17 #include "DecompConstants.h"
18 
19 // --------------------------------------------------------------------- //
20 class DecompParam {
21 private:
22  DecompParam(const DecompParam&);
23  DecompParam& operator=(const DecompParam&);
24 
25 public:
26 
27  int LogLevel;
29  int LogDebugLevel;
30  int LogLpLevel; //name? inner solver
31  unsigned int LimitInitVars; //?? specific to PC? make own section ??
32  double TolZero;
37  double LimitTime;
39  int CutDC;
40  int CutCGL;
41  //subsection?
42  int CutCglKnapC;
43  int CutCglFlowC;
44  int CutCglMir;
45  int CutCglClique;
46 
47 public:
48  void getSettings(UtilParameters& utilParam) {
49  static const char* common = "DECOMP";
50  LogLevel = utilParam.GetSetting("LogLevel", 0, common);
51  LogAppLevel = utilParam.GetSetting("LogAppLevel", 0, common);
52  LogDebugLevel = utilParam.GetSetting("LogDebugLevel", 0, common);
53  LogLpLevel = utilParam.GetSetting("LogLpLevel", 0, common);
54  LimitInitVars = utilParam.GetSetting("LimitInitVars", 1, common);
55  TolZero = utilParam.GetSetting("TolZero",
56  DecompEpsilon, common);
57  LimitTotalCutIters = utilParam.GetSetting("LimitTotalCutIters",
58  2000, common);
59  LimitTotalPriceIters = utilParam.GetSetting("LimitTotalPriceIters",
60  2000, common);
61  LimitRoundCutIters = utilParam.GetSetting("LimitRoundCutIters",
62  2000, common);
63  LimitRoundPriceIters = utilParam.GetSetting("LimitRoundPriceIters",
64  2000, common);
65  LimitTime = utilParam.GetSetting("LimitTime",
66  600, common);
67  //TODO: what if we want multi-poly on just 1st and 3rd - TODO
68  PriceMultiPoly = utilParam.GetSetting("PriceMultiPoly",
69  0, common);
70  CutDC = utilParam.GetSetting("CutDC",
71  0, common);
72  CutCGL = utilParam.GetSetting("CutCGL",
73  0, common);
74  CutCglKnapC = utilParam.GetSetting("CutCglKnapC",
75  0, common);
76  CutCglFlowC = utilParam.GetSetting("CutCglFlowC",
77  0, common);
78  CutCglMir = utilParam.GetSetting("CutCglMir",
79  0, common);
80  CutCglClique = utilParam.GetSetting("CutCglClique",
81  0, common);
82  }
83 
84  //this should be a parameter method, should parameter be an object?
85  //have user register parameters, so can set usage too
86  void dumpSettings(ostream* os = &cout) {
87  static const char* common = "DECOMP";
88  (*os) << "\n========================================================\n"
89  << "DECOMP PARAMETER SETTINGS \n";
90  (*os) << common << ": LogLevel = " << LogLevel << endl;
91  (*os) << common << ": LogAppLevel = " << LogAppLevel << endl;
92  (*os) << common << ": LogDebugLevel = " << LogDebugLevel << endl;
93  (*os) << common << ": LogLpLevel = " << LogLpLevel << endl;
94  (*os) << common << ": LimitInitVars = " << LimitInitVars << endl;
95  (*os) << common << ": TolZero = " << TolZero << endl;
96  (*os) << common << ": LimitTotalCutIters = "
97  << LimitTotalCutIters << endl;
98  (*os) << common << ": LimitTotalPriceIters = "
99  << LimitTotalPriceIters << endl;
100  (*os) << common << ": LimitRoundCutIters = "
101  << LimitRoundCutIters << endl;
102  (*os) << common << ": LimitRoundPriceIters = "
103  << LimitRoundPriceIters << endl;
104  (*os) << common << ": PriceMultiPoly= " << PriceMultiPoly << endl;
105  (*os) << common << ": CutDC = " << CutDC << endl;
106  (*os) << common << ": CutCGL = " << CutCGL << endl;
107  (*os) << common << ": CutCglKnapC = " << CutCglKnapC << endl;
108  (*os) << common << ": CutCglFlowC = " << CutCglFlowC << endl;
109  (*os) << common << ": CutCglMir = " << CutCglMir << endl;
110  (*os) << common << ": CutCglClique = " << CutCglClique << endl;
111  (*os) << "========================================================\n";
112  }
113 
114 public:
116  LogLevel(0),
117  LogAppLevel(0),
118  LogDebugLevel(0),
119  LogLpLevel(0),
120  LimitInitVars(1),
122  LimitTotalCutIters(2000),
123  LimitTotalPriceIters(2000),
124  LimitRoundCutIters(2000),
125  LimitRoundPriceIters(2000),
126  LimitTime(60),
127  PriceMultiPoly(0),
128  CutDC(0),
129  CutCGL(0),
130  CutCglKnapC(0),
131  CutCglFlowC(0),
132  CutCglMir(0),
133  CutCglClique(0)
134  {}
135 
137 };
138 
139 #endif
int LimitTotalPriceIters
Definition: DecompParam.h:34
void dumpSettings(ostream *os=&cout)
Definition: DecompParam.h:86
int CutCglClique
Definition: DecompParam.h:104
int LimitRoundCutIters
Definition: DecompParam.h:35
const double DecompEpsilon
Definition: Decomp.h:100
int LimitRoundPriceIters
Definition: DecompParam.h:36
DecompParam()
Default constructors.
Definition: DecompParam.h:723
int PriceMultiPoly
Definition: DecompParam.h:38
unsigned int LimitInitVars
Definition: DecompParam.h:31
string GetSetting(const char *name, const char *defaultValue, const char *section=NULL)
double TolZero
Definition: DecompParam.h:61
void getSettings(UtilParameters &utilParam)
Definition: DecompParam.h:48
int LogDebugLevel
Definition: DecompParam.h:39
int LogLpLevel
Definition: DecompParam.h:40
int LimitTotalCutIters
Definition: DecompParam.h:33
int LogAppLevel
Definition: DecompParam.h:28
double LimitTime
Definition: DecompParam.h:37