queso-0.53.0
EnvironmentOptions.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008-2015 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #ifndef UQ_ENVIRONMENT_OPTIONS_H
26 #define UQ_ENVIRONMENT_OPTIONS_H
27 
28 #include <string>
29 #include <set>
30 #include <vector>
31 
32 #include <queso/BoostInputOptionsParser.h>
33 
34 #define UQ_ENV_FILENAME_FOR_NO_OUTPUT_FILE "."
35 #define UQ_ENV_FILENAME_FOR_NO_INPUT_FILE "."
36 
37 #define UQ_ENV_HELP ""
38 #define UQ_ENV_NUM_SUB_ENVIRONMENTS_ODV 1
39 #define UQ_ENV_SUB_SCREEN_WRITE_ODV 0
40 #define UQ_ENV_SUB_DISPLAY_FILE_NAME_ODV UQ_ENV_FILENAME_FOR_NO_OUTPUT_FILE
41 #define UQ_ENV_SUB_DISPLAY_ALLOW_ALL_ODV 0
42 #define UQ_ENV_SUB_DISPLAY_ALLOW_INTER0_ODV 0
43 #define UQ_ENV_SUB_DISPLAY_ALLOWED_SET_ODV ""
44 #define UQ_ENV_DISPLAY_VERBOSITY_ODV 0
45 #define UQ_ENV_SYNC_VERBOSITY_ODV 0
46 #define UQ_ENV_CHECKING_LEVEL_ODV 0
47 #define UQ_ENV_RNG_TYPE_ODV "gsl"
48 #define UQ_ENV_SEED_ODV 0
49 #define UQ_ENV_IDENTIFYING_STRING_ODV ""
50 #define UQ_ENV_PLATFORM_NAME_ODV ""
51 #define UQ_ENV_NUM_DEBUG_PARAMS_ODV 0
52 #define UQ_ENV_DEBUG_PARAM_ODV 0.
53 
54 // Forward declarations
55 namespace boost {
56  namespace program_options {
57  class options_description;
58  }
59 }
60 
61 namespace QUESO {
62 
63 // Forward declarations
64 class BaseEnvironment;
65 
79 {
80 public:
82 
85  EnvOptionsValues(const BaseEnvironment * env, const char * prefix);
86 
89 
91  virtual ~EnvOptionsValues();
93 
95 
99 
100  std::string m_prefix;
101 
104  std::string m_help;
105 
108  unsigned int m_numSubEnvironments;
109 
111  std::string m_subDisplayFileName;
112 
114 
118 
120 
124 
126 
130  std::set<unsigned int> m_subDisplayAllowedSet;
131 
133  unsigned int m_displayVerbosity;
134 
136  unsigned int m_syncVerbosity;
137 
139  unsigned int m_checkingLevel;
140 
142  std::string m_rngType;
143 
145 
151  int m_seed;
152 
154  std::string m_platformName;
155 
157  std::string m_identifyingString;
158 
160  unsigned int m_numDebugParams;
161 
163  std::vector<double> m_debugParams;
165 
166 private:
168 
170  std::string m_option_help;
171 
174 
177 
180 
183 
186 
189 
192 
195 
197  std::string m_option_rngType;
198 
200  std::string m_option_seed;
201 
204 
207 
209  void copy(const EnvOptionsValues& src);
210 
212  void checkOptions();
213 
215  friend std::ostream& operator<<(std::ostream& os,
216  const EnvOptionsValues & obj);
217 };
218 
226 {
227 public:
229 
230 
232  EnvironmentOptions(const BaseEnvironment& env, const char* prefix);
233 
235  EnvironmentOptions(const BaseEnvironment& env, const char* prefix, const EnvOptionsValues& alternativeOptionsValues);
236 
240 
242 
243  void scanOptionsValues();
245 
247  void print (std::ostream& os) const;
249 
250 
253 
254 private:
256  void defineMyOptions (boost::program_options::options_description& optionsDesc) const;
257 
259  void getMyOptionValues(boost::program_options::options_description& optionsDesc);
260 
263 
265  std::string m_prefix;
266 
268 
271  boost::program_options::options_description* m_optionsDesc;
272 
273  std::string m_option_help;
274 
277 
280 
283 
286 
289 
292 
295 
298 
300  std::string m_option_rngType;
301 
303 
305  std::string m_option_seed;
306 
309 
312 };
313 
315 std::ostream& operator<<(std::ostream& os, const EnvironmentOptions& obj);
316 
317 } // End namespace QUESO
318 
319 #endif // UQ_ENVIRONMENT_CLASS_H
std::string m_option_rngType
Input file option name for m_rngType.
std::string m_option_subDisplayAllowInter0
Input file option name for m_subDisplayAllowInter0.
boost::program_options::options_description * m_optionsDesc
Environment options description.
void defineMyOptions(boost::program_options::options_description &optionsDesc) const
Define my environment options as the default options.
std::string m_option_seed
Input file option name for m_seed.
std::string m_option_help
Input file option name for flagging helpful printing output.
std::string m_option_subDisplayFileName
Input file option name for m_subDisplayFileName.
void scanOptionsValues()
Scans option values from input file.
virtual ~EnvOptionsValues()
Destructor.
std::string m_option_subDisplayFileName
My output filename for sub-screen writing.
unsigned int m_checkingLevel
Checking level.
int m_seed
Seed of the random number generator.
std::string m_option_identifyingString
Identifying string.
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
This class provides a suite options one can pass to a QUESO environment.
unsigned int m_syncVerbosity
Synchronized verbosity.
void getMyOptionValues(boost::program_options::options_description &optionsDesc)
Gets the option values of the environment.
unsigned int m_displayVerbosity
Verbosity.
std::string m_option_identifyingString
Input file option name for m_identifyingString.
std::string m_subDisplayFileName
Output filename for sub-screen writing.
std::string m_option_platformName
Input file option name for m_platformName.
std::string m_option_subDisplayAllowedSet
Sub-environments that will write to output.
std::string m_option_displayVerbosity
Input file option name for m_displayVerbosity.
std::string m_option_rngType
Type of the random number generator.
std::string m_option_subDisplayAllowAll
Allows (or not) all sub-environments to write to output file.
EnvOptionsValues & operator=(const EnvOptionsValues &rhs)
Operator for copying the options of an environment.
std::string m_option_syncVerbosity
Input file option name for m_syncVerbosity.
unsigned int m_numDebugParams
Number of debug parameters. Unused?
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:193
void copy(const EnvOptionsValues &src)
Makes an exact copy of an existing EnvOptionsValues instance.
std::string m_option_subDisplayAllowInter0
Allows (or not) all inter0 nodes to write to output file.
bool m_subDisplayAllowAll
Allows (or not) all sub-environments to write to output file.
BoostInputOptionsParser * m_parser
EnvOptionsValues m_ov
Instance of EnvOptionsValues, a class with default values for QUESO environment.
std::set< unsigned int > m_subDisplayAllowedSet
Sub-environments that will write to output.
std::string m_option_syncVerbosity
Synchronized verbosity.
std::string m_option_numSubEnvironments
My number of sub-environments.
std::string m_option_checkingLevel
Checking level.
std::string m_option_subDisplayAllowAll
Input file option name for m_subDisplayAllowAll.
friend std::ostream & operator<<(std::ostream &os, const EnvOptionsValues &obj)
Print values of the options chosen.
This class reads options one can pass to a QUESO environment through an input file.
std::vector< double > m_debugParams
Debug parameters. Unused?
std::string m_option_subDisplayAllowedSet
Input file option name for m_subDisplayAllowedSet.
EnvOptionsValues()
Default constructor.
std::string m_rngType
Type of the random number generator.
std::string m_prefix
Options prefix.
std::string m_platformName
Platform name.
std::string m_identifyingString
Identifying string.
std::string m_option_platformName
Platform name.
std::string m_option_checkingLevel
Input file option name for m_checkingLevel.
std::string m_option_seed
Seed of the random number generator.
bool m_subDisplayAllowInter0
Allows (or not) all inter0 nodes to write to output file.
void checkOptions()
Sorts out any inter-option conflicts.
const BaseEnvironment & m_env
Environment.
EnvironmentOptions(const BaseEnvironment &env, const char *prefix)
Default constructor.
std::string m_option_numSubEnvironments
Input file option name for m_numSubEnvironments.
std::string m_option_displayVerbosity
Verbosity.
void print(std::ostream &os) const
Print values of the options chosen.

Generated on Thu Jun 11 2015 13:52:31 for queso-0.53.0 by  doxygen 1.8.5