← Documentation
ADS-IDAC Engine 5.0.0
EventSchemaUnit.cpp
Go to the documentation of this file.
1// EventSchemaUnit.cpp: implementation of the EventSchemaUnit class.
2//
4
5#include "EventSchemaUnit.h"
6#include "ReasonMachine.h"
7#include "../Procedure/Procedures.h"
8#include "../Global/SimulationContext.h"
9using namespace std;
10
11
13// Construction/Destruction
15
17{
18 this->m_event_KE_pt = NULL;
19 this->m_procedure_name = "NONE";
20 this->m_procedure_step_name = "NONE";
21 this->m_procedure_step_pt = NULL;
22 this->m_max_delay = 1200;
23}
24
26{
27 this->m_symptom_list.clear();
28}
29
30//DEL string EventSchemaUnit::m_procedure_step()
31//DEL {
32//DEL
33//DEL }
34
36{
37 this->m_ID_KE = this->m_event_KE_pt->m_ID;
38 //this->m_procedure_name = this->m_procedure_step_pt->getCurrentProcedureName();
39 //this->m_procedure_step_name = this->m_procedure_step_pt->getCurrentStepName();
40
41 for(auto &e : this->m_symptom_list)
42 {
43 e->ConvertESUinfoToStringForm();
44 }
45}
46
48{
51 this->m_ID_KE = _ESU_pt->m_ID_KE;
52 this->m_max_delay = _ESU_pt->m_max_delay;
53 this->m_operator = _ESU_pt->m_operator;
54 this->m_procedure_name = _ESU_pt->m_procedure_name;
56
57 for(auto &e : _ESU_pt->m_symptom_list)
58 {
59 auto symptom_pt = std::make_unique<EventSymptomUnit>();
60 symptom_pt->CopyEventSymptomUnitFromAnotherWithoutPointer(e.get());
61 this->m_symptom_list.push_back(std::move(symptom_pt));
62 }
63}
64
66{
67 ReasonMachine * RM_pt;
68 RM_pt = (ReasonMachine*)_pt;
69 map<string, ProcedureStep *>::iterator procedure_map_itr;
70/*
71 ProcedureStep * m_procedure_step_pt;
72 KnowledgeElement * m_event_KE_pt;
73 vector<EventSymptomUnit *> m_symptom_list;
74
75 string m_ID_KE;
76 string m_procedure_step_name;
77 string m_procedure_name;
78*/
79 if(this->m_procedure_name.compare("NONE") != 0 && this->m_procedure_step_name.compare("NONE") != 0)
80 {
81 procedure_map_itr = g_sim.All_procedure.procedure_map.find(this->m_procedure_name + this->m_procedure_step_name);
82 if(procedure_map_itr != g_sim.All_procedure.procedure_map.end())
83 {
84 this->m_procedure_step_pt = procedure_map_itr->second;
85 }
86 else
87 {
88 this->ErrorMessage("Could not find this procedure step: " + this->m_procedure_name + this->m_procedure_step_name);
89 return;
90 }
91 }
92
93 if(this->m_ID_KE.compare("") != 0)
94 {
96 if(this->m_event_KE_pt == NULL)
97 {this->ErrorMessage("this->m_event_KE_pt == NULL"); return;}
98 }
99
100 for(auto &e : this->m_symptom_list)
101 {e->BuildConnectionsForThisEventSymptomUnit(_pt);}
102
103}
104
106{
107 cout << r5pars_.timesno << " " << str << " in EventSchemaUnit" << '\n';
108 ofstream fout("err messages.txt", ios::app);
109 fout << r5pars_.timesno << " " << str << '\n';
110 fout.close();
111}
Diagnostic reasoning engine — knowledge representation, mental model, and inference.
SimulationContext g_sim
Global simulation context: the single instance, defined in SimulationContext.cpp.
document e
void ConvertESUinfoToString()
std::vector< std::unique_ptr< EventSymptomUnit > > m_symptom_list
std::string m_procedure_step_name
ProcedureStep * m_procedure_step_pt
virtual ~EventSchemaUnit()
KnowledgeElement * m_event_KE_pt
float m_diagnose_claim_threshold
void CopyESUInfoWithoutPointerFromAnother(EventSchemaUnit *)
std::string m_procedure_name
std::string m_ID_KE
void ErrorMessage(std::string)
void BuildConnectionsForThisESU(void *)
void CopyIDElementToRestartInfo(IDElement *)
Definition: IDElement.cpp:23
std::string m_ID
Definition: IDElement.h:16
std::map< std::string, ProcedureStep * > procedure_map
Definition: Procedures.h:72
KnowledgeElement * FindKnowledgeElementByID(std::string)
struct @0 r5pars_
Procedures All_procedure
Emergency operating procedures.