Stride Reference Manual  - generated for commit 9643b11
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RunConfigManager.h
Go to the documentation of this file.
1 /*
2  * This is free software: you can redistribute it and/or modify it
3  * under the terms of the GNU General Public License as published by
4  * the Free Software Foundation, either version 3 of the License, or
5  * any later version.
6  * The software is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  * GNU General Public License for more details.
10  * You should have received a copy of the GNU General Public License
11  * along with the software. If not, see <http://www.gnu.org/licenses/>.
12  *
13  * Copyright 2017, Kuylen E, Willem L, Broeckhove J
14  */
15 
21 #pragma once
22 
23 #include "util/ConfigInfo.h"
24 
25 #include <boost/property_tree/ptree_fwd.hpp>
26 #include <string>
27 #include <vector>
28 
29 namespace stride {
30 namespace util {
31 
36 {
37 public:
39  static void AddGeoPopConfig(boost::property_tree::ptree& pt);
40 
42  static void CleanConfigFile(boost::property_tree::ptree pt);
43 
45  static boost::property_tree::ptree Create(const std::string& configName);
46 
48  static std::vector<unsigned int> CreateNumThreads(unsigned int maxNum = ConfigInfo::NumberAvailableThreads());
49 
51  static boost::property_tree::ptree FromString(const std::string& s);
52 
54  static std::string ToString(const boost::property_tree::ptree& pt);
55 
57  static std::string ToSha1(const boost::property_tree::ptree& pt);
58 
60  static std::string ToShortSha1(const boost::property_tree::ptree& pt, unsigned int n = 7U);
61 
62 private:
64  static std::string CreateBenchInfluenza();
65 
67  static std::string CreateBenchMeasles();
68 
70  static std::string CreateDefault();
71 
73  static std::string CreateTestsInfluenza();
74 
76  static std::string CreateTestsMeasles();
77 };
78 
79 } // namespace util
80 } // namespace stride
static unsigned int NumberAvailableThreads()
Return number of threads (in case of OpenMP).
Definition: ConfigInfo.cpp:44
static std::string ToSha1(const boost::property_tree::ptree &pt)
Produce the sha1 hash of property tree (of it&#39;s string representation).
static std::string CreateBenchInfluenza()
Produce Influenza config for Benchmarking.
static std::vector< unsigned int > CreateNumThreads(unsigned int maxNum=ConfigInfo::NumberAvailableThreads())
Set of threadcounts to use for tests based an nomber of available OpenMP threads. ...
static boost::property_tree::ptree Create(const std::string &configName)
Produce property tree for config with given name.
static void CleanConfigFile(boost::property_tree::ptree pt)
Clean (i.e. indent, sort and produde the sha1) the ptree config file.
static std::string ToString(const boost::property_tree::ptree &pt)
Produce string representation of property tree.
static std::string CreateTestsInfluenza()
Produce Influenza config for scenario tests.
static std::string ToShortSha1(const boost::property_tree::ptree &pt, unsigned int n=7U)
Produce the short sha1 hash of property tree (of it&#39;s string representation).
Info on configuration.
static void AddGeoPopConfig(boost::property_tree::ptree &pt)
Adapt the configuration by adding the gengeopop data items.
static std::string CreateTestsMeasles()
Produce Measles config for scenario tests.
static std::string CreateBenchMeasles()
Produce Measles config for Benchmarking.
static boost::property_tree::ptree FromString(const std::string &s)
Reconstitute property tree from string representation.
static std::string CreateDefault()
Produce the deefault config.
Namespace for the simulator and related classes.
Definition: Calendar.cpp:28
Produce run config ptree.