← Documentation
ADS-IDAC Engine 5.0.0
ExpectedMentalBelief.cpp
Go to the documentation of this file.
1// ExpectedMentalBelief.cpp: implementation of the ExpectedMentalBelief class.
2//
4
6#include <boost/serialization/export.hpp>
7#include <boost/archive/binary_oarchive.hpp>
8#include <boost/archive/binary_iarchive.hpp>
9BOOST_CLASS_EXPORT_IMPLEMENT(ExpectedMentalBelief)
10using namespace std;
11
13// Construction/Destruction
15
17{
19
20}
21
23{
24
25}
26
29
31 string name;
32 int next_OR;
33 double remaining_time;
34 fin >> name >> expected_state >> next_OR;
35 this->setInfoName(name);
36 this->setORLink(next_OR);
37}
40 this->copyKBElement(_mp);
41 this->copyTimer(_mp);
43 this->copyExpectationElement(_mp);
44 this->copyStateOfActivation(_mp);
45}
47 fout << expected_state << '\n';
48 this->saveKBElementToFile(fout);
49 this->saveTimerToFile(fout);
53}
55 fin >> expected_state;
57 this->retrieveTimerFromFile(fin);
61}
63 bool matched = true;
65 !this->checkIfIsIdenticalTimer(_emb)){
66 matched = false;
67 }
68 return matched;
69}
70
71#include <boost/archive/binary_oarchive.hpp>
72#include <boost/archive/binary_iarchive.hpp>
73
74void ExpectedMentalBelief::state_save(boost::archive::binary_oarchive& ar) const {
77 const int soa = const_cast<ExpectedMentalBelief*>(this)->getStateOfActivation();
78 ar << soa;
79}
80void ExpectedMentalBelief::state_load(boost::archive::binary_iarchive& ar) {
83 int soa = 0;
84 ar >> soa;
86}
virtual void state_load(boost::archive::binary_iarchive &ar)
void saveExpectationElementToFile(std::ofstream &)
virtual void state_save(boost::archive::binary_oarchive &ar) const
void retrieveExpectationElementFromFile(std::ifstream &)
bool checkIfIsIdenticalExpectationElement(ExpectationElement &)
void copyExpectationElement(ExpectationElement &)
void saveExpectedMentalBeliefToFile(std::ofstream &)
void readInfoFromFile(std::ifstream &)
void retrieveExpectedMentalBeliefFromFile(std::ifstream &)
void copyExpectedMentalBelief(ExpectedMentalBelief &)
void state_save(boost::archive::binary_oarchive &ar) const override
bool checkIfIsIdenticalExpectedMentalBelief(ExpectedMentalBelief &)
void state_load(boost::archive::binary_iarchive &ar) override
void setInfoName(std::string)
Definition: KBElement.cpp:25
void retrieveKBElementFromFile(std::ifstream &)
Definition: KBElement.cpp:36
bool checkIfIsIdenticalKBElement(KBElement &)
Definition: KBElement.cpp:39
void saveKBElementToFile(std::ofstream &)
Definition: KBElement.cpp:33
void copyKBElement(KBElement &)
Definition: KBElement.cpp:30
void setStateOfActivation(int)
void saveStateOfActivationToFile(std::ofstream &)
void retrieveStateOfActivationFromFile(std::ifstream &)
void copyStateOfActivation(StateOfActivation &)
void saveTimerToFile(std::ofstream &)
Definition: Timer.cpp:54
void retrieveTimerFromFile(std::ifstream &)
Definition: Timer.cpp:59
double remaining_time
Definition: Timer.h:77
void copyTimer(Timer &)
Definition: Timer.cpp:44
void timer_state_save(Archive &ar) const
Definition: Timer.h:22
void timer_state_load(Archive &ar)
Definition: Timer.h:26
bool checkIfIsIdenticalTimer(Timer &)
Definition: Timer.cpp:64
constexpr int None
Definition: SimConstants.h:75