Stride Reference Manual  - generated for commit 9643b11
SummaryFile.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 <boost/property_tree/ptree_fwd.hpp>
24 #include <fstream>
25 #include <string>
26 
27 namespace stride {
28 namespace output {
29 
34 {
35 public:
37  explicit SummaryFile(const std::string& output_prefix = "output");
38 
40  ~SummaryFile();
41 
43  void Print(const boost::property_tree::ptree& config_pt, unsigned int population_size, unsigned int num_cases,
44  double transmission_probability, unsigned int run_time, unsigned int total_time);
45 
46 private:
48  void Initialize(const std::string& output_dir);
49 
50 private:
51  std::ofstream m_fstream;
52 };
53 
54 } // namespace output
55 } // namespace stride
Produces a file with simulation summary output.
Definition: SummaryFile.h:33
void Initialize(const std::string &output_dir)
Generate file name and open the file stream.
Definition: SummaryFile.cpp:40
~SummaryFile()
Destructor: close the file stream.
Definition: SummaryFile.cpp:38
SummaryFile(const std::string &output_prefix="output")
Constructor: initialize.
Definition: SummaryFile.cpp:36
Namespace for the simulator and related classes.
Definition: Calendar.cpp:28
std::ofstream m_fstream
The file stream.
Definition: SummaryFile.h:51
void Print(const boost::property_tree::ptree &config_pt, unsigned int population_size, unsigned int num_cases, double transmission_probability, unsigned int run_time, unsigned int total_time)
Print the given output with corresponding tag.
Definition: SummaryFile.cpp:54