← Documentation
ADS-IDAC Engine 5.0.0
BranchProcedureActionTimeUnit.cpp
Go to the documentation of this file.
1// BranchProcedureActionTimeUnit.cpp: implementation of the BranchProcedureActionTimeUnit class.
2//
4
6#include <boost/serialization/export.hpp>
7#include <boost/archive/binary_oarchive.hpp>
8#include <boost/archive/binary_iarchive.hpp>
9BOOST_CLASS_EXPORT_IMPLEMENT(BranchProcedureActionTimeUnit)
10using namespace std;
11
13// Construction/Destruction
15
17{
18
19 procedure_name = "NONE";
20 step_name = "NONE";
21 action_name = "NONE";
23}
24
26{
28}
30 procedure_name = "NONE";
31 step_name = "NONE";
32 action_name = "NONE";
34 this->probabilities.clear();
35 this->time_ratio.clear();
36}
46 this->probabilities.push_back(x);
47}
49 this->time_ratio.push_back(x);
50}
52 vector<double>::iterator d_itr;
54 step_name = _bpatu.getStepName();
55 action_name = _bpatu.getActionName();
57/* for(d_itr = _bpatu.probabilities.begin(); d_itr != _bpatu.probabilities.end(); d_itr++){
58 this->probabilities.push_back(*d_itr);
59 }
60 for(d_itr = _bpatu.time_ratio.begin(); d_itr != _bpatu.time_ratio.end(); d_itr++){
61 this->time_ratio.push_back(*d_itr);
62 }
63*/
64 }
66 vector<double>::iterator d_itr;
67 fout << procedure_name << ' '
68 << step_name << ' '
69 << action_name << ' '
70 << num_of_branches << '\n';
71/* << "Time_Ratio ";
72 for(d_itr = this->time_ratio.begin(); d_itr != this->time_ratio.end(); d_itr++){
73 fout << *d_itr << ' ';
74 }
75 fout << "\nProbability ";
76 for(d_itr = this->probabilities.begin(); d_itr != this->probabilities.end(); d_itr++){
77 fout << *d_itr << ' ';
78 }
79 fout << '\n';
80*/
81}
83 string str;
84 double value;
85 int i;
86 fin >> procedure_name
87 >> step_name
88 >> action_name
90// time branches are set up in ProcedureStepUnit::ExecuteAction by Monte Carlo simulation
91// >> str;
92// for(i = 0; i < num_of_branches; i++){
93// fin >> value;
94// this->time_ratio.push_back(value);
95// }
96// fin >> str;
97// for(i = 0; i < num_of_branches; i++){
98// fin >> value;
99// this->probabilities.push_back(value);
100// }
101}
104};
105bool BranchProcedureActionTimeUnit::checkIfBranchesNeedToBeGenerated(string _procedure_name, string _step_name, string _action_name){
106 bool generate_branches = false;
107 if (_procedure_name == procedure_name && _step_name == step_name && _action_name == action_name) {
108 generate_branches = true;
109 }
110 return generate_branches;
111}
void copyBranchProcedureActionTimeUnit(BranchProcedureActionTimeUnit &)
bool checkIfBranchesNeedToBeGenerated(std::string, std::string, std::string)
void retrieveBranchProcedureActionTimeUnitFromFile(std::ifstream &)
void saveBranchProcedureActionTimeUnitToFile(std::ofstream &)