← Documentation
ADS-IDAC Engine 5.0.0
HardWiredProcedureActivity.cpp
Go to the documentation of this file.
1// HardWiredProcedureActivity.cpp: implementation of the HardWiredProcedureActivity class.
2//
4
6#include "../Global/SimulationContext.h"
7#include <boost/serialization/export.hpp>
8#include <boost/archive/binary_oarchive.hpp>
9#include <boost/archive/binary_iarchive.hpp>
10BOOST_CLASS_EXPORT_IMPLEMENT(HardWiredProcedureActivity)
11using namespace std;
12
14// Construction/Destruction
16
18{
21}
22
24{
25
26}
29int HardWiredProcedureActivity::checkForMatch(string _name, int _state){
30 string str = this->getInfoName();
31 int n_return = 0;
32 if(_name.compare(str) == 0){
33 if (_state == this->getExpectedState()){
35 }
36 else{
38 }
39 }
40 else{
41 n_return = 0;
42 }
43 return n_return;
44}
46 this->copyExpectationElement(_hpa);
47 this->copyKBElement(_hpa);
49};
51 string str;
52 fin >> str >> expected_state;
53 this->setInfoName(str);
54}
56 fout << "HardWiredProcedureActivity " << expected_state << '\n';
58 this->saveKBElementToFile(fout);
59}
61 string str;
62 fin >> str >> expected_state;
63 if (str != "HardWiredProcedureActivity"){
64 ofstream fout("err messages.txt", ios::app);
65 cout << "HardWiredProcedureActivity::retrieveHardWiredProcedureActivityFromFile in previous function" << endl;
66 fout << r5pars_.timesno << " HardWiredProcedureActivity::retrieveHardWiredProcedureActivityFromFile error in previous function\n";
67 fout.close();
68 r5pars_.sim_err = true;
69 g_sim.Branch_center.setTempESMessage("HardWiredProcedureActivity::retrieveHardWiredProcedureActivityFromFile Prior err.");
71 return;
72 }
75}
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 copyHardWiredProcedureActivity(HardWiredProcedureActivity &)
void retrieveHardWiredProcedureActivityFromFile(std::ifstream &)
void saveHardWiredProcedureActivityToFile(std::ofstream &)
void setInfoName(std::string)
Definition: KBElement.cpp:25
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
struct @0 r5pars_
constexpr int Procedure
Definition: SimConstants.h:261
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.