← Documentation
ADS-IDAC Engine 5.0.0
BranchExpectedAlarmState.cpp
Go to the documentation of this file.
1// BranchExpectedAlarmState.cpp: implementation of the BranchExpectedAlarmState class.
2//
4
5#include <sstream>
7#include "../Global/ConvertToString.h"
8#include <boost/serialization/export.hpp>
9#include "../Global/SimulationContext.h"
10#include <boost/archive/binary_oarchive.hpp>
11#include <boost/archive/binary_iarchive.hpp>
12BOOST_CLASS_EXPORT_IMPLEMENT(BranchExpectedAlarmState)
13using namespace std;
14
15
17// Construction/Destruction
19
21
22}
23
25
26}
31};
33 string str;
34 str = "Alarm: Sender: ";
35 str += g_sim.Translator.getString(this->getSender());
36 str += "; Receiver: ";
38 str += " Alarm: ";
39 str += this->getAlarmName();
40 str += "; Status: ";
42 str += "; Exp State: ";
44 str += "; Observed State: ";
47 str += ";Use of Memorized Info";
48 }
49 str += "; New Probability: ";
50 std::ostringstream streamObj;
51 streamObj << this->getProbability();
52 str += streamObj.str();
53 return str;
54}
56 string str;
57 str = ";Status:";
59 str += ";_Exp_State:";
61 str += ";_Observed_State:";
64 str += ";_Use_of_Memorized_Info";
65 }
66 fout << ' ' << this->getSender() << ' ' << sim::Action::SendInfo << ' ' << this->getObservedAlarmState() << ' '
67 << this->getInfoName() << ' ' << this->getProbability() << ' '
68 << this->getTimeOfCommunication() << ' ' << this->getRemainingTime() << ' ' << " 0.0 "
69 << this->getExpectedState() << ' '
70 << '"' << "Intended_Receiver:" << g_sim.Translator.getString(this->getIntendedReceiver()) << ';' << str << '"' << '\n';
71}
75 this->saveCommunicationToFile(fout);
76}
81}
SimulationContext g_sim
Global simulation context: the single instance, defined in SimulationContext.cpp.
std::string getAlarmName()
void retrieveBranchExpectedAlarmStateFromFile(std::ifstream &)
void copyBranchExpectedAlarmState(BranchExpectedAlarmState &)
void saveBranchExpectedAlarmStateToFile(std::ofstream &)
double getTimeOfCommunication()
void saveCommunicationToFile(std::ofstream &)
int getIntendedReceiver()
void retrieveCommunicationFromFile(std::ifstream &)
void copyCommunication(Communication &)
std::string getString(int) const
void retrieveDecisionExpectedAlarmStateFromFile(std::ifstream &)
void copyDecisionExpectedAlarmState(DecisionExpectedAlarmState &)
void saveDecisionExpectedAlarmStateToFile(std::ofstream &)
std::string getInfoName()
Definition: KBElement.cpp:26
int getObservedAlarmState()
Definition: MentalAlarm.cpp:33
double getProbability()
Definition: Probability.cpp:27
void saveTimerAndProbabilityToFile(std::ofstream &)
void copyTimerAndProbability(TimerAndProbability &)
void retrieveTimerAndProbabilityFromFile(std::ifstream &)
double getRemainingTime()
Definition: Timer.cpp:31
constexpr int SendInfo
Definition: SimConstants.h:204
constexpr int OldInfo
Definition: SimConstants.h:126
ConvertToString Translator
Parameter name/value conversion.