← Documentation
ADS-IDAC Engine 5.0.0
Label.cpp
Go to the documentation of this file.
1// Label.cpp: implementation of the Label class.
2//
4
5#include "Label.h"
6#include "ReasonMachine.h"
7using namespace std;
8
10// Construction/Destruction
12
14{
15 this->m_lable_name = "";
16}
17
19{
20 this->m_ID_option_list.clear();
21 this->m_label_option_list.clear();
22/*
23 vector<IDElement *> m_label_option_list;
24 vector<string> m_ID_option_list;
25*/
26}
27
29{//this function does not establish the pointer connections
30 this->m_lable_name = _label_pt->m_lable_name;
31 vector<string >::iterator str_itr;
32 string ID;
33
34 for(str_itr = _label_pt->m_ID_option_list.begin(); str_itr != _label_pt->m_ID_option_list.end(); str_itr++)
35 {
36 ID = *str_itr;
37 this->m_ID_option_list.push_back(ID);
38 }
39}
40
42{
43 vector<IDElement *>::iterator ID_itr;
44 string ID;
45 if(this->m_ID_option_list.size() == 0)
46 {
47 for(ID_itr = this->m_label_option_list.begin(); ID_itr != this->m_label_option_list.end(); ID_itr++)
48 {
49 ID = (*ID_itr)->m_ID;
50 this->m_ID_option_list.push_back(ID);
51 }
52 }
53}
54
56{
57
58 ReasonMachine * RM_pt;
59 RM_pt = (ReasonMachine *)_pt;
60 //vector<IDElement *> m_label_option_list;
61 //vector<string> m_ID_option_list;
62 vector<string>::iterator str_itr;
63 IDElement * ID_pt;
64 for(str_itr = this->m_ID_option_list.begin(); str_itr != this->m_ID_option_list.end(); str_itr++)
65 {
66 ID_pt = RM_pt->m_Concept_Base->FindConceptByID(*str_itr);
67 if(ID_pt == NULL)
68 {this->ErrorMessage("could not find the Concept " + *str_itr); return;}
69 this->m_label_option_list.push_back(ID_pt);
70 }
71}
72
73void Label::ErrorMessage(string str)
74{
75 cout << r5pars_.timesno << " " << str << " in Label.cpp" <<'\n';
76 ofstream fout("err messages.txt", ios::app);
77 fout << r5pars_.timesno << " " << str << '\n';
78 fout.close();
79 //r5pars_.terminateall = true;
80}
Diagnostic reasoning engine — knowledge representation, mental model, and inference.
Definition: Label.h:13
void CopyLabelInfoFromAnotherLabel(Label *_label_pt)
Definition: Label.cpp:28
std::vector< IDElement * > m_label_option_list
Definition: Label.h:21
virtual ~Label()
Definition: Label.cpp:18
void ConvertLabelInfoToStringForm()
Definition: Label.cpp:41
std::string m_lable_name
Definition: Label.h:20
void BuildConnectionsForThisLabel(void *)
Definition: Label.cpp:55
std::vector< std::string > m_ID_option_list
Definition: Label.h:22
void ErrorMessage(std::string)
Definition: Label.cpp:73
Label()
Definition: Label.cpp:13
std::unique_ptr< KBConcept > m_Concept_Base
struct @0 r5pars_