← Documentation
ADS-IDAC Engine 5.0.0
BranchExpectedComponentState.cpp
Go to the documentation of this file.
1// BranchExpectedComponentState.cpp: implementation of the BranchExpectedComponentState 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(BranchExpectedComponentState)
13using namespace std;
14
15
17// Construction/Destruction
19
21
22}
23
25
26}
31}
33 string str;
34 str = "Component: Sender: ";
35 str += g_sim.Translator.getString(this->getSender());
36 str += "; Receiver: ";
38 str += "; Component: ";
39 str += this->getDisplayName();
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->getObservedComponentState() << ' '
67 << this->getInfoName() << ' ' << this->getProbability() << ' '
68 << this->getTimeOfCommunication() << ' ' << this->getRemainingTime() << " 0.0 " << this->getStateOfExpectation()
69 << ' '
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.
void retrieveBranchExpectedComponentStateFromFile(std::ifstream &)
void copyBranchExpectedComponentState(BranchExpectedComponentState &)
void saveBranchExpectedComponentStateToFile(std::ofstream &)
double getTimeOfCommunication()
void saveCommunicationToFile(std::ofstream &)
int getIntendedReceiver()
void retrieveCommunicationFromFile(std::ifstream &)
void copyCommunication(Communication &)
std::string getString(int) const
void retrieveDecisionExpectedComponentStateFromFile(std::ifstream &)
void copyDecisionExpectedComponentState(DecisionExpectedComponentState &)
void saveDecisionExpectedComponentStateToFile(std::ofstream &)
std::string getDisplayName()
std::string getInfoName()
Definition: KBElement.cpp:26
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.