← Documentation
ADS-IDAC Engine 5.0.0
ExpectationElement.cpp
Go to the documentation of this file.
1// ExpectationElement.cpp: implementation of the ExpectationElement class.
2//
4
6#include "../Global/TermConversions.h"
7#include <boost/serialization/export.hpp>
8#include <boost/archive/binary_oarchive.hpp>
9#include <boost/archive/binary_iarchive.hpp>
10BOOST_CLASS_EXPORT_IMPLEMENT(ExpectationElement)
11using namespace std;
12
14// Construction/Destruction
16
18{
21}
22
24{
25
26}
29int ExpectationElement::updateExpectation(int _fulfilled_state){
30 int n_return = 0;
31 if(_fulfilled_state == sim::State::Succeed){
33 n_return = 0;
34 }
37 n_return = 2;
38 }
39 else{
41 n_return = 1;
42 }
43 }
44 else if(_fulfilled_state == sim::State::Failed){
47 n_return = -2;
48 }
50 n_return = 0;
51 }
52 // if state_of_expectation is sim::None, set n_return to 0 to keep belief confidecne > 0
55 n_return = 0;
56 }
57 //
58 else{
60 n_return = -1;
61 }
62 }
63 else {
65 n_return = 0;
66 }
67 return n_return;
68}
72}
76 fout << state_of_expectation << ' ' << type_of_expectation << '\n';
77}
80}
82 bool matched = true;
84 matched = false;
85 }
86 return matched;
87}
88
89#include <boost/archive/binary_oarchive.hpp>
90#include <boost/archive/binary_iarchive.hpp>
91
92void ExpectationElement::state_save(boost::archive::binary_oarchive& ar) const {
93 ar << state_of_expectation; // type_of_expectation is seeded definition
94}
95void ExpectationElement::state_load(boost::archive::binary_iarchive& ar) {
97}
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 &)
constexpr int Failed
Definition: SimConstants.h:103
constexpr int Succeed
Definition: SimConstants.h:104
constexpr int None
Definition: SimConstants.h:75