queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
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-2017 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/config_queso.h>
33 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
34 #include <queso/BoostInputOptionsParser.h>
35 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
36 
37 #include <queso/ScopedPtr.h>
38 
39 #define UQ_ENV_FILENAME_FOR_NO_OUTPUT_FILE "."
40 #define UQ_ENV_FILENAME_FOR_NO_INPUT_FILE "."
41 
42 #define UQ_ENV_HELP ""
43 #define UQ_ENV_NUM_SUB_ENVIRONMENTS_ODV 1
44 #define UQ_ENV_SUB_SCREEN_WRITE_ODV 0
45 #define UQ_ENV_SUB_DISPLAY_FILE_NAME_ODV UQ_ENV_FILENAME_FOR_NO_OUTPUT_FILE
46 #define UQ_ENV_SUB_DISPLAY_ALLOW_ALL_ODV 0
47 #define UQ_ENV_SUB_DISPLAY_ALLOW_INTER0_ODV 0
48 #define UQ_ENV_SUB_DISPLAY_ALLOWED_SET_ODV ""
49 #define UQ_ENV_DISPLAY_VERBOSITY_ODV 0
50 #define UQ_ENV_SYNC_VERBOSITY_ODV 0
51 #define UQ_ENV_CHECKING_LEVEL_ODV 0
52 #define UQ_ENV_RNG_TYPE_ODV "gsl"
53 #define UQ_ENV_SEED_ODV 0
54 #define UQ_ENV_IDENTIFYING_STRING_ODV ""
55 #define UQ_ENV_PLATFORM_NAME_ODV ""
56 #define UQ_ENV_NUM_DEBUG_PARAMS_ODV 0
57 #define UQ_ENV_DEBUG_PARAM_ODV 0.
58 
59 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
60 // Forward declarations
61 namespace boost {
62  namespace program_options {
63  class options_description;
64  }
65 }
66 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
67 
68 namespace QUESO {
69 
70 // Forward declarations
71 class BaseEnvironment;
72 
86 {
87 public:
89 
92  EnvOptionsValues(const BaseEnvironment * env, const char * prefix);
93 
96 
98  virtual ~EnvOptionsValues();
100 
102 
106 
107  std::string m_prefix;
108 
111  std::string m_help;
112 
115  unsigned int m_numSubEnvironments;
116 
118  std::string m_subDisplayFileName;
119 
121 
125 
127 
131 
133 
137  std::set<unsigned int> m_subDisplayAllowedSet;
138 
140  unsigned int m_displayVerbosity;
141 
143  unsigned int m_syncVerbosity;
144 
146  unsigned int m_checkingLevel;
147 
149  std::string m_rngType;
150 
152 
158  int m_seed;
159 
161  std::string m_platformName;
162 
164  std::string m_identifyingString;
165 
167  unsigned int m_numDebugParams;
168 
170  std::vector<double> m_debugParams;
172 
173 private:
175 
176 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
178 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
179 
181  std::string m_option_help;
182 
185 
188 
191 
194 
197 
200 
203 
206 
208  std::string m_option_rngType;
209 
211  std::string m_option_seed;
212 
215 
218 
220  void copy(const EnvOptionsValues& src);
221 
223  void checkOptions();
224 
226  friend std::ostream& operator<<(std::ostream& os,
227  const EnvOptionsValues & obj);
228 };
229 
237 {
238 public:
240 
241 
243  EnvironmentOptions(const BaseEnvironment& env, const char* prefix);
244 
246  EnvironmentOptions(const BaseEnvironment& env, const char* prefix, const EnvOptionsValues& alternativeOptionsValues);
247 
251 
253 
254  void scanOptionsValues();
256 
258  void print (std::ostream& os) const;
260 
261 
264 
265 private:
266 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
267  void defineMyOptions (boost::program_options::options_description& optionsDesc) const;
269 
271  void getMyOptionValues(boost::program_options::options_description& optionsDesc);
272 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
273 
276 
278  std::string m_prefix;
279 
281 
284 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
286 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
287 
288  std::string m_option_help;
289 
292 
295 
298 
301 
304 
307 
310 
313 
315  std::string m_option_rngType;
316 
318 
320  std::string m_option_seed;
321 
324 
327 };
328 
330 std::ostream& operator<<(std::ostream& os, const EnvironmentOptions& obj);
331 
332 } // End namespace QUESO
333 
334 #endif // UQ_ENVIRONMENT_CLASS_H
std::string m_option_checkingLevel
Input file option name for m_checkingLevel.
EnvOptionsValues & operator=(const EnvOptionsValues &rhs)
Operator for copying the options of an environment.
bool m_subDisplayAllowAll
Allows (or not) all sub-environments to write to output file.
virtual ~EnvOptionsValues()
Destructor.
bool m_subDisplayAllowInter0
Allows (or not) all inter0 nodes to write to output file.
void print(std::ostream &os) const
Print values of the options chosen.
EnvOptionsValues m_ov
Instance of EnvOptionsValues, a class with default values for QUESO environment.
unsigned int m_checkingLevel
Checking level.
std::string m_option_syncVerbosity
Synchronized verbosity.
std::unique_ptr< T > Type
Definition: ScopedPtr.h:76
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:198
std::string m_option_identifyingString
Input file option name for m_identifyingString.
EnvOptionsValues()
Default constructor.
std::ostream & operator<<(std::ostream &os, const SequenceStatisticalOptions &obj)
std::string m_option_numSubEnvironments
My number of sub-environments.
void scanOptionsValues()
Scans option values from input file.
std::string m_option_checkingLevel
Checking level.
std::string m_option_displayVerbosity
Input file option name for m_displayVerbosity.
ScopedPtr< BoostInputOptionsParser >::Type m_parser
std::string m_option_subDisplayAllowedSet
Input file option name for m_subDisplayAllowedSet.
std::string m_option_identifyingString
Identifying string.
std::string m_option_seed
Input file option name for m_seed.
std::string m_option_subDisplayFileName
My output filename for sub-screen writing.
std::string m_prefix
Options prefix.
std::string m_platformName
Platform name.
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.
const BaseEnvironment & m_env
Environment.
std::set< unsigned int > m_subDisplayAllowedSet
Sub-environments that will write to output.
std::string m_option_subDisplayAllowedSet
Sub-environments that will write to output.
std::string m_option_platformName
Platform name.
std::string m_option_rngType
Type of the random number generator.
std::string m_option_subDisplayAllowAll
Input file option name for m_subDisplayAllowAll.
std::string m_option_seed
Seed of the random number generator.
void checkOptions()
Sorts out any inter-option conflicts.
friend std::ostream & operator<<(std::ostream &os, const EnvOptionsValues &obj)
Print values of the options chosen.
EnvironmentOptions(const BaseEnvironment &env, const char *prefix)
Default constructor.
std::string m_option_subDisplayAllowInter0
Input file option name for m_subDisplayAllowInter0.
void defineMyOptions(boost::program_options::options_description &optionsDesc) const
Define my environment options as the default options.
std::string m_option_subDisplayAllowInter0
Allows (or not) all inter0 nodes to write to output file.
std::string m_rngType
Type of the random number generator.
std::string m_identifyingString
Identifying string.
std::string m_option_syncVerbosity
Input file option name for m_syncVerbosity.
void copy(const EnvOptionsValues &src)
Makes an exact copy of an existing EnvOptionsValues instance.
This class provides a suite options one can pass to a QUESO environment.
ScopedPtr< boost::program_options::options_description >::Type m_optionsDesc
Environment options description.
std::string m_option_numSubEnvironments
Input file option name for m_numSubEnvironments.
const BaseEnvironment * m_env
unsigned int m_displayVerbosity
Verbosity.
void getMyOptionValues(boost::program_options::options_description &optionsDesc)
Gets the option values of the environment.
std::string m_subDisplayFileName
Output filename for sub-screen writing.
std::string m_option_rngType
Input file option name for m_rngType.
int m_seed
Seed of the random number generator.
std::string m_option_platformName
Input file option name for m_platformName.
std::vector< double > m_debugParams
Debug parameters. Unused?
unsigned int m_syncVerbosity
Synchronized verbosity.
std::string m_option_displayVerbosity
Verbosity.
std::string m_option_subDisplayAllowAll
Allows (or not) all sub-environments to write to output file.
This class reads options one can pass to a QUESO environment through an input file.

Generated on Tue Jun 5 2018 19:48:54 for queso-0.57.1 by  doxygen 1.8.5