← Documentation
ADS-IDAC Engine 5.0.0
KBExpectedSupportSystemStateUnit.cpp
Go to the documentation of this file.
2#include "../Branch/BranchRecord.h"
3#include <boost/serialization/export.hpp>
4#include "../Global/SimulationContext.h"
5#include <boost/archive/binary_oarchive.hpp>
6#include <boost/archive/binary_iarchive.hpp>
7BOOST_CLASS_EXPORT_IMPLEMENT(KBExpectedSupportSystemStateUnit)
8using namespace std;
9
10
12{
16}
18{
19
20}
24 fin >> expected_state;
25}
26int KBExpectedSupportSystemStateUnit::checkForMatch(string _ss_name, int _ss_state){
27 int n_return = 0;
28 if(_ss_name.compare(KBElement::getInfoName()) == 0){
29 if (_ss_state == expected_state){
31 }
32 else{
34 }
35 }
36 else{
37 n_return = 0;
38 }
39 return n_return;
40}
45}
46
49 fout << "KBExpectedSupportSystemStateUnit " << expected_state << '\n';
51 this->saveKBElementToFile(fout);
52}
54 string str;
55 fin >> str >> expected_state;
56 if (str != "KBExpectedSupportSystemStateUnit"){
57 ofstream fout("err messages.txt", ios::app);
58 cout << "KBExpectedSupportSystemStateUnit::retrieveKBExpectedSupportSystemStateUnitFromFile error in previous function" << endl;
59 fout << r5pars_.timesno << " KBExpectedSupportSystemStateUnit::retrieveKBExpectedSupportSystemStateUnitFromFile error in previous function\n";
60 fout.close();
61 r5pars_.sim_err = true;
62 g_sim.Branch_center.setTempESMessage("KBExpectedSupportSystemStateUnit::retrieveKBExpectedSupportSystemStateUnitFromFile Prior error");
64 return;
65 }
68}
SimulationContext g_sim
Global simulation context: the single instance, defined in SimulationContext.cpp.
void setTempTypeOfConsequence(Consequence)
Stores the consequence of the end state the running sequence will get.
void setTempESMessage(std::string)
Stores the description of the end state the running sequence will get if it is terminated (set by mod...
void saveExpectationElementToFile(std::ofstream &)
void retrieveExpectationElementFromFile(std::ifstream &)
void copyExpectationElement(ExpectationElement &)
void readInfoFromFile(std::ifstream &)
Definition: KBElement.cpp:27
void retrieveKBElementFromFile(std::ifstream &)
Definition: KBElement.cpp:36
void saveKBElementToFile(std::ofstream &)
Definition: KBElement.cpp:33
void copyKBElement(KBElement &)
Definition: KBElement.cpp:30
std::string getInfoName()
Definition: KBElement.cpp:26
void copyKBExpectedSupportSystemStateUnit(KBExpectedSupportSystemStateUnit &)
void retrieveKBExpectedSupportSystemStateUnitFromFile(std::ifstream &)
struct @0 r5pars_
constexpr int SupportSystemState
Definition: SimConstants.h:292
constexpr int Failed
Definition: SimConstants.h:103
constexpr int Succeed
Definition: SimConstants.h:104
constexpr int None
Definition: SimConstants.h:75
BranchRecord Branch_center
Dynamic event tree state.