← Documentation
ADS-IDAC Engine 5.0.0
BranchExpectedMentalBelief.cpp
Go to the documentation of this file.
1// BranchExpectedMentalBelief.cpp: implementation of the BranchExpectedMentalBelief 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(BranchExpectedMentalBelief)
13using namespace std;
14
15
17// Construction/Destruction
19
21 activation_time = 0.0;
22
23}
24
26
27}
33 this->copyCommunication(_mp);
34 this->copyExpectedMentalBelief(_mp);
35 this->copyProbability(_mp);
36 //this->copyStateOfActivation(_mp);
39}
42 fout << ' ' << this->getSender() << ' ' << sim::Branch::MentalBelief << ' ' << this->getStateOfExpectation() << ' '
43 << this->getInfoName() << ' ' << this->getProbability() << ' '
44 << this->getTimeOfCommunication() << ' ' << this->getRemainingTime() << " 0.0 0 "
45 << '"' << "Intended_Receiver:" << g_sim.Translator.getString(this->getIntendedReceiver()) << ";ACT:"
47 << ";EXP:" << g_sim.Translator.getString(this->getStateOfExpectation()) << '"' << '\n';
48 } else {
49 fout << ' ' << this->getSender() << ' ' << sim::Branch::MentalBelief << ' ' << this->getStateOfExpectation() << ' '
50 << this->getInfoName() << ' ' << this->getProbability() << ' '
51 << this->getTimeOfCommunication() << ' ' << this->getRemainingTime() << " 0.0 0 " << '"'
52 << "Intended_Receiver:"
53 << g_sim.Translator.getString(this->getIntendedReceiver()) << ";From_memorized_info" << ";ACT:"
55 << ";EXP:" << g_sim.Translator.getString(this->getStateOfActivation()) << '"' << '\n';
56 }
57};
59 string str;
60 str = "Mental Belief: Sender: ";
61 str += g_sim.Translator.getString(this->getSender());
62 str += "; Receiver: ";
64 str += "; Belief: ";
65 str += this->getInfoName();
66 str += ';';
68 str += " Use of Memorized Info; ";
69 str += "Expected State: ";
71 str += "; Status: ";
73 } else {
74 str += " Status: ";
76 }
77 str += "; New Probability: ";
78 std::ostringstream streamObj;
79 streamObj << this->getProbability();
80 str += streamObj.str();
81 return str;
82}
84 fout << activation_time << ' '
85 << mental_priority << '\n';
87 this->saveCommunicationToFile(fout);
88 this->saveProbabilityToFile(fout);
89 //this->saveStateOfActivationToFile(fout);
90}
92 fin >> activation_time
97 //this->retrieveStateOfActivationFromFile(fin);
98}
SimulationContext g_sim
Global simulation context: the single instance, defined in SimulationContext.cpp.
void copyBranchExpectedMentalBelief(BranchExpectedMentalBelief &)
void saveBranchExpectedMentalBeliefToFile(std::ofstream &)
void retrieveBranchExpectedMentalBeliefFromFile(std::ifstream &)
double getTimeOfCommunication()
void saveCommunicationToFile(std::ofstream &)
int getIntendedReceiver()
void retrieveCommunicationFromFile(std::ifstream &)
void copyCommunication(Communication &)
std::string getString(int) const
void saveExpectedMentalBeliefToFile(std::ofstream &)
void retrieveExpectedMentalBeliefFromFile(std::ifstream &)
void copyExpectedMentalBelief(ExpectedMentalBelief &)
std::string getInfoName()
Definition: KBElement.cpp:26
double getProbability()
Definition: Probability.cpp:27
void copyProbability(Probability &)
Definition: Probability.cpp:28
void saveProbabilityToFile(std::ofstream &)
Definition: Probability.cpp:34
void retrieveProbabilityFromFile(std::ifstream &)
Definition: Probability.cpp:39
double getRemainingTime()
Definition: Timer.cpp:31
constexpr int MentalBelief
Definition: SimConstants.h:265
constexpr int OldInfo
Definition: SimConstants.h:126
ConvertToString Translator
Parameter name/value conversion.