← Documentation
ADS-IDAC Engine 5.0.0
BranchSupportSystemAction.cpp
Go to the documentation of this file.
1#include <sstream>
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(BranchSupportSystemAction)
8using namespace std;
9
10
13}
15}
17 this->copyControlElement( _bsp);
18 this->copyCommunication( _bsp);
19 this->copyTimerAndProbability(_bsp);
21}
23 string str;
24 str = "SSReliability: Sender: ";
25 str += g_sim.Translator.getString(this->getSender());
26 str += "; Receiver: ";
28 str += "; Support System: ";
29 str += this->getDisplayName();
31 str += "; Status: Success";
32 }
34 str += "; Status: Fail";
35 }
37 str += "; Status: Maneuver Action";
38 }
39 else{
40 }
41 str += "; FT Node: ";
43 str += "; Probability: ";
44 std::ostringstream streamObj;
45 streamObj << this->getProbability();
46 str += streamObj.str();
47 return str;
48}
50 fout << ' ' << this->getSender() << ' ' << sim::Action::Direct << ' ' << sim::None << ' ' << this->getDisplayName() << ' ' << this->getProbability() << ' '
51 << this->getTimeOfCommunication() << ' ' << this->getAdjustedTimeRequiredToPerformTheAction() << ' ' << this->getControlValue() << " 0 ";
53 fout << '"' << "Failed!_Intended_Receiver:" << g_sim.Translator.getString(this->getIntendedReceiver()) << '"' << '\n';
54 }
55 else{
56 fout << '"' << "Success!_Intended_Receiver:" << g_sim.Translator.getString(this->getIntendedReceiver()) << '"' << '\n';
57 }
58}
62 fout << functional_state << '\n';
63 this->saveControlElementToFile(fout);
64 this->saveCommunicationToFile(fout);
66}
68 fin >> functional_state;
72}
SimulationContext g_sim
Global simulation context: the single instance, defined in SimulationContext.cpp.
void retrieveBranchSupportSystemActionFromFile(std::ifstream &)
void copyBranchSupportSystemAction(BranchSupportSystemAction &)
void saveBranchSupportSystemActionToFile(std::ofstream &)
double getTimeOfCommunication()
void saveCommunicationToFile(std::ofstream &)
int getIntendedReceiver()
void retrieveCommunicationFromFile(std::ifstream &)
void copyCommunication(Communication &)
std::string getDisplayName()
void saveControlElementToFile(std::ofstream &)
void retrieveControlElementFromFile(std::ifstream &)
std::string getCorrespondingComponentNameOfControl()
double getControlValue()
double getAdjustedTimeRequiredToPerformTheAction()
void copyControlElement(ControlElement &)
std::string getString(int) const
double getProbability()
Definition: Probability.cpp:27
void saveTimerAndProbabilityToFile(std::ofstream &)
void copyTimerAndProbability(TimerAndProbability &)
void retrieveTimerAndProbabilityFromFile(std::ifstream &)
constexpr int Direct
Definition: SimConstants.h:202
constexpr int Failed
Definition: SimConstants.h:103
constexpr int Succeed
Definition: SimConstants.h:104
constexpr int Control
Definition: SimConstants.h:111
constexpr int Unknown
Definition: SimConstants.h:120
constexpr int None
Definition: SimConstants.h:75
ConvertToString Translator
Parameter name/value conversion.