← Documentation
ADS-IDAC Engine 5.0.0
EventSymptomUnit.cpp
Go to the documentation of this file.
1// EventSymptomUnit.cpp: implementation of the EventSymptomUnit class.
2//
4
5#include "EventSymptomUnit.h"
6#include "ReasonMachine.h"
7using namespace std;
8
10// Construction/Destruction
12
14{
15 this->m_symptom_KE_pt = NULL;
16 this->m_symptom_transient_bl = false;
17}
18
20{
21 this->m_KU_list.clear();
22 this->m_ID_KU_list.clear();
23}
24
26{
27 vector<KnowledgeUnit *>::iterator KU_itr;
28 string ID;
29 this->m_ID_KE = this->m_symptom_KE_pt->m_ID;
30
31 if(this->m_ID_KU_list.size() != 0)
32 {return;}
33 for(KU_itr = this->m_KU_list.begin(); KU_itr != this->m_KU_list.end(); KU_itr++)
34 {
35 ID = (*KU_itr)->m_ID;
36 this->m_ID_KU_list.push_back(ID);
37 }
38
39}
40
42{
44 this->m_ID_KE = _sym_pt->m_ID_KE;
46 vector<string>::iterator str_itr;
47 string ID;
48 for(str_itr = _sym_pt->m_ID_KU_list.begin(); str_itr != _sym_pt->m_ID_KU_list.end(); str_itr++)
49 {
50 ID = *str_itr;
51 this->m_ID_KU_list.push_back(ID);
52 }
53}
54
56{
57 ReasonMachine * RM_pt;
58 RM_pt = (ReasonMachine*)_pt;
59/*
60 KnowledgeElement * m_symptom_KE_pt;
61 vector<KnowledgeUnit *> m_KU_list;
62
63 string m_ID_KE;
64 vector<string> m_ID_KU_list;
65*/
67 if(this->m_symptom_KE_pt == NULL)
68 {this->ErrorMessage("this->m_symptom_KE_pt == NULL"); return;}
69
70 vector<string>::iterator str_itr;
71 KnowledgeUnit * KU_pt;
72 for(str_itr = this->m_ID_KU_list.begin(); str_itr != this->m_ID_KU_list.end(); str_itr++)
73 {
74 KU_pt = RM_pt->FindKnowledgeUnitByID(*str_itr);
75 if(KU_pt == NULL)
76 {this->ErrorMessage("could not find this knowledge unit " + *str_itr); return;}
77 this->m_KU_list.push_back(KU_pt);
78 }
79}
80
82{
83 cout << r5pars_.timesno << " " << str << " in EventSymptomUnit" << '\n';
84 ofstream fout("err messages.txt", ios::app);
85 fout << r5pars_.timesno << " " << str << '\n';
86 fout.close();
87}
Diagnostic reasoning engine — knowledge representation, mental model, and inference.
virtual ~EventSymptomUnit()
std::vector< KnowledgeUnit * > m_KU_list
std::string m_ID_KE
void ConvertESUinfoToStringForm()
void ErrorMessage(std::string)
void CopyEventSymptomUnitFromAnotherWithoutPointer(EventSymptomUnit *)
void BuildConnectionsForThisEventSymptomUnit(void *)
KnowledgeElement * m_symptom_KE_pt
std::vector< std::string > m_ID_KU_list
void CopyIDElementToRestartInfo(IDElement *)
Definition: IDElement.cpp:23
std::string m_ID
Definition: IDElement.h:16
KnowledgeUnit * FindKnowledgeUnitByID(std::string)
KnowledgeElement * FindKnowledgeElementByID(std::string)
struct @0 r5pars_