Dip-All  0.91.0
AlpsDecompParam.h
Go to the documentation of this file.
1 //===========================================================================//
2 // This file is part of the DIP Solver Framework. //
3 // //
4 // DIP is distributed under the Eclipse Public License as part of the //
5 // COIN-OR repository (http://www.coin-or.org). //
6 // //
7 // Author: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com) //
8 // //
9 // Conceptual Design: Matthew Galati, SAS Institute Inc. //
10 // Ted Ralphs, Lehigh University //
11 // //
12 // Copyright (C) 2002-2015, Lehigh University, Matthew Galati, Ted Ralphs //
13 // All Rights Reserved. //
14 //===========================================================================//
15 
16 //===========================================================================//
17 #ifndef AlpsDecompParam_h_
18 #define AlpsDecompParam_h_
19 
20 //===========================================================================//
21 #include "UtilParameters.h"
22 
23 //===========================================================================//
29 //===========================================================================//
30 
31 //===========================================================================//
33 
34  //----------------------------------------------------------------------//
39  //----------------------------------------------------------------------//
40 
41 public:
49 
55 
60 
69  int msgLevel;
70 
74  int nodeLimit;
75 
80 
81 
82  //-----------------------------------------------------------------------//
87  //-----------------------------------------------------------------------//
88 public:
89  void getSettings(UtilParameters& param) {
90  static const char* sec = "ALPS";
91  logFileLevel = param.GetSetting("logFileLevel", 0, sec);
92  printSolution = param.GetSetting("printSolution", false, sec);
93  checkMemory = param.GetSetting("checkMemory", false, sec);
94  msgLevel = param.GetSetting("msgLevel", 2, sec);
95  nodeLimit = param.GetSetting("nodeLimit", ALPS_INT_MAX, sec);
96  nodeLogInterval = param.GetSetting("nodeLogInterval", 10, sec);
97 
98  if (msgLevel > 2) {
99  dumpSettings();
100  }
101  }
102 
103  void dumpSettings(std::ostream* os = &std::cout) {
104  static const char* sec = "ALPS";
105  (*os) << "\n========================================================\n"
106  << "ALPS PARAMETER SETTINGS \n";
107  (*os) << sec << ": logFileLevel = " << logFileLevel << std::endl;
108  (*os) << sec << ": printSolution = " << printSolution << std::endl;
109  (*os) << sec << ": checkMemory = " << checkMemory << std::endl;
110  (*os) << sec << ": msgLevel = " << msgLevel << std::endl;
111  (*os) << sec << ": nodeLimit = " << nodeLimit << std::endl;
112  (*os) << sec << ": nodeLogInterval = " << nodeLogInterval << std::endl;
113  }
118  //-----------------------------------------------------------------------//
123  //-----------------------------------------------------------------------//
124 public:
129 
131  getSettings(utilParam);
132  }
133 
141 };
142 
143 #endif
AlpsDecompParam(UtilParameters &utilParam)
Default constructors.
#define ALPS_INT_MAX
Definition: Alps.h:150
string GetSetting(const char *name, const char *defaultValue, const char *section=NULL)
bool checkMemory
Check memory.
AlpsDecompParam()
Default constructors.
Parameters passed through to Alps.
int msgLevel
The level of printing messages on screen.
void getSettings(UtilParameters &param)
bool printSolution
Print solution to screen and log if have a solution and msgLevel and logFileLevel permits...
int nodeLogInterval
Node log interval.
void dumpSettings(std::ostream *os=&std::cout)
int logFileLevel
The level of log file.
int nodeLimit
The max number of nodes can be processed.
~AlpsDecompParam()
Destructor.