queso-0.53.0
MonteCarloSGOptions.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_MOC_SG_OPTIONS_H
26 #define UQ_MOC_SG_OPTIONS_H
27 
28 #include <queso/Environment.h>
29 #include <queso/SequenceStatisticalOptions.h>
30 #include <queso/BoostInputOptionsParser.h>
31 
32 #define UQ_MOC_SG_FILENAME_FOR_NO_FILE "."
33 
34 // _ODV = option default value
35 #define UQ_MOC_SG_HELP ""
36 #define UQ_MOC_SG_DATA_OUTPUT_FILE_NAME_ODV UQ_MOC_SG_FILENAME_FOR_NO_FILE
37 #define UQ_MOC_SG_DATA_OUTPUT_ALLOWED_SET_ODV ""
38 
39 #define UQ_MOC_SG_PSEQ_DATA_OUTPUT_PERIOD_ODV 0
40 #define UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_NAME_ODV UQ_MOC_SG_FILENAME_FOR_NO_FILE
41 #define UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
42 #define UQ_MOC_SG_PSEQ_DATA_OUTPUT_ALLOWED_SET_ODV ""
43 #define UQ_MOC_SG_PSEQ_COMPUTE_STATS_ODV 0
44 
45 #define UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_NAME_ODV UQ_MOC_SG_FILENAME_FOR_NO_FILE
46 #define UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
47 #define UQ_MOC_SG_QSEQ_SIZE_ODV 100
48 #define UQ_MOC_SG_QSEQ_DISPLAY_PERIOD_ODV 500
49 #define UQ_MOC_SG_QSEQ_MEASURE_RUN_TIMES_ODV 0
50 #define UQ_MOC_SG_QSEQ_DATA_OUTPUT_PERIOD_ODV 0
51 #define UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_NAME_ODV UQ_MOC_SG_FILENAME_FOR_NO_FILE
52 #define UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
53 #define UQ_MOC_SG_QSEQ_DATA_OUTPUT_ALLOWED_SET_ODV ""
54 #define UQ_MOC_SG_QSEQ_COMPUTE_STATS_ODV 0
55 
56 namespace boost {
57  namespace program_options {
58  class options_description;
59  }
60 }
61 
62 namespace QUESO {
63 
75 {
76 public:
78 
79 
80 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
81  McOptionsValues (const SsOptionsValues* alternativePSsOptionsValues,
82  const SsOptionsValues* alternativeQSsOptionsValues);
83  McOptionsValues (const SsOptionsValues* alternativePSsOptionsValues,
84  const SsOptionsValues* alternativeQSsOptionsValues,
85  const BaseEnvironment * env, const char * prefix);
86 #else
87 
89  McOptionsValues ();
90 
92  McOptionsValues(const BaseEnvironment * env, const char * prefix);
93 #endif
94 
96  McOptionsValues (const McOptionsValues& src);
97 
99  virtual ~McOptionsValues ();
101 
103 
107 
108  std::string m_prefix;
109 
111  std::string m_help;
112 
113  std::string m_dataOutputFileName;
114  std::set<unsigned int> m_dataOutputAllowedSet;
115 
119  std::set<unsigned int> m_pseqDataOutputAllowedSet;
120 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
121  bool m_pseqComputeStats;
122 #endif
123 
126  unsigned int m_qseqSize;
127  unsigned int m_qseqDisplayPeriod;
132  std::set<unsigned int> m_qseqDataOutputAllowedSet;
133 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
134  bool m_qseqComputeStats;
135 #endif
136 
137 private:
139 
140  std::string m_option_help;
143 
148 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
149  std::string m_option_pseq_computeStats;
150 #endif
151 
154  std::string m_option_qseq_size;
161 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
162  std::string m_option_qseq_computeStats;
163 #endif
164 
166  void copy(const McOptionsValues& src);
167 
168  void checkOptions();
169 
170  friend std::ostream & operator<<(std::ostream & os,
171  const McOptionsValues & obj);
172 
173 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
174  friend class MonteCarloSGOptions;
175  SsOptionsValues m_alternativePSsOptionsValues;
176  SsOptionsValues m_alternativeQSsOptionsValues;
177 #endif
178 };
179 
180 // --------------------------------------------------
181 // --------------------------------------------------
182 // --------------------------------------------------
183 
193 {
194 public:
195 
197 
198  MonteCarloSGOptions(const BaseEnvironment& env, const char* prefix);
200 
202 
204  MonteCarloSGOptions(const BaseEnvironment& env, const char* prefix, const McOptionsValues& alternativeOptionsValues);
205 
209 
211 
212  void scanOptionsValues();
214 
216  void print (std::ostream& os) const;
218 
220 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
221  SequenceStatisticalOptions* m_pseqStatisticalOptionsObj;
222  SequenceStatisticalOptions* m_qseqStatisticalOptionsObj;
223 #endif
224  std::string m_prefix;
225 
226 private:
228  void defineMyOptions (boost::program_options::options_description& optionsDesc) const;
229 
231  void getMyOptionValues(boost::program_options::options_description& optionsDesc);
232 
234  boost::program_options::options_description* m_optionsDesc;
235 
236  std::string m_option_help;
239 
244 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
245  std::string m_option_pseq_computeStats;
246 #endif
247 
250  std::string m_option_qseq_size;
257 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
258  std::string m_option_qseq_computeStats;
259 #endif
260 };
261 
263 std::ostream& operator<<(std::ostream& os, const MonteCarloSGOptions& obj);
264 
265 } // End namespace QUESO
266 
267 #endif // UQ_MOC_SG_OPTIONS_H
std::string m_option_qseq_dataOutputFileType
std::string m_option_qseq_dataOutputAllowedSet
void scanOptionsValues()
It scans the option values from the options input file.
std::string m_option_pseq_dataOutputFileType
BoostInputOptionsParser * m_parser
std::string m_option_qseq_dataOutputFileName
std::string m_option_qseq_displayPeriod
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
std::set< unsigned int > m_pseqDataOutputAllowedSet
std::string m_option_dataOutputAllowedSet
std::string m_option_dataOutputFileName
This class provides options for the Monte Carlo sequence generator if no input file is available...
void print(std::ostream &os) const
It prints the option values.
std::string m_option_qseq_dataOutputPeriod
void copy(const McOptionsValues &src)
Copies the option values from src to this.
McOptionsValues()
Default constructor.
std::string m_option_pseq_dataOutputFileName
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:193
boost::program_options::options_description * m_optionsDesc
McOptionsValues & operator=(const McOptionsValues &rhs)
Assignment operator; it copies rhs to this.
const BaseEnvironment & m_env
std::string m_help
If non-empty string, print options and values to output file.
This class reads the options for the Monte Carlo sequence generator from an input file...
std::string m_option_qseq_dataInputFileType
std::string m_option_qseq_dataOutputAllowedSet
virtual ~McOptionsValues()
Destructor.
std::set< unsigned int > m_dataOutputAllowedSet
std::string m_option_pseq_dataOutputPeriod
std::string m_option_pseq_dataOutputAllowedSet
std::set< unsigned int > m_qseqDataOutputAllowedSet
std::string m_option_qseq_measureRunTimes
void defineMyOptions(boost::program_options::options_description &optionsDesc) const
Defines the options for the Monte Carlo sequence generator as the default options.
void getMyOptionValues(boost::program_options::options_description &optionsDesc)
Gets the sequence options.
MonteCarloSGOptions(const BaseEnvironment &env, const char *prefix)
Constructor: reads options from the input file.
std::string m_option_qseq_dataInputFileName
std::string m_option_pseq_dataOutputAllowedSet
friend std::ostream & operator<<(std::ostream &os, const McOptionsValues &obj)

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