← Documentation
ADS-IDAC Engine 5.0.0
KB.cpp
Go to the documentation of this file.
1// KB.cpp: implementation of the KB class.
2//
4
5#include "KB.h"
6#include <boost/serialization/export.hpp>
7#include "../Global/SimulationContext.h"
8#include <boost/archive/binary_oarchive.hpp>
9#include <boost/archive/binary_iarchive.hpp>
10BOOST_CLASS_EXPORT_IMPLEMENT(KB)
11using namespace std;
12
14// Construction/Destruction
16
18
19}
20
22 this->clearKB();
23}
29 system_function_map.clear();
30}
31
32void KB::initiationForSimulation(int _operator, InfoChunk &_perceived_info) {
33 this->readSystemDecompositionKB(_operator);
34 this->readHardWiredDiagnosis(_operator, _perceived_info);
35 this->readIndicatorBiasFactors(_operator);
36 //this->m_Concept_Base.ReadKBConceptInfoFromInputFile(_operator); //Y.L.
37 //this->m_MP.ReadMentalRepresentationtInfoFromFile(_operator); //Y.L.
38 //
39}
40void KB::readHardWiredDiagnosis(int _operator, InfoChunk &_perceived_info) {
41 string file_name;
42 string str;
43 int n_diagnosis;
44 bool got_operator = true;
45 ExpectedMentalBelief *mental_belief_ptr;
46 decltype(hard_wired_diagnosis)::iterator mental_belief_itr;
47//
48 int i;
49 if (_operator == sim::Operator::ODM) {
50 file_name = g_sim.SScheduler.getODMDirectory();
51 file_name += "KB_ODM_HardWired_Diagnosis.txt";
52 } else if (_operator == sim::Operator::OCT) {
53 file_name = g_sim.SScheduler.getOCTDirectory();
54 file_name += "KB_OCT_HardWired_Diagnosis.txt";
55 } else if (_operator == sim::Operator::OAT) {
56 file_name = g_sim.SScheduler.getOATDirectory();
57 file_name += "KB_OAT_HardWired_Diagnosis.txt";
58 } else {
59 ofstream fout("err messages.txt", ios::app);
60 cout << "KB::readHardWiredDiagnosis: " << _operator << " is not one of the three operators." << endl;
61 fout << r5pars_.timesno << " KB::readHardWiredDiagnosis: " << _operator << " is not one of the three operators.\n";
62 fout.close();
63 r5pars_.sim_err = true;
64 g_sim.Branch_center.setTempESMessage("KB::readHardWiredDiagnosis err.");
66 got_operator = false;
67 }
68 if (got_operator) {//read in information
69 i = 0;
70 ifstream fin(file_name.c_str(), ios::in);
71 if (!fin.is_open()) {
72 cout << "File: " << file_name << " cound not be found" << endl;
73 ofstream fout("err messages.txt", ios::app);
74 fout << r5pars_.timesno << " File: " << file_name << " cound not be found\n";
75 fout.close();
76 r5pars_.sim_err = true;
77 g_sim.Branch_center.setTempESMessage("KB::readHardWiredDiagnosis err.");
79 } else {
80 fin >> str >> n_diagnosis;
81 for (i = 0; i < n_diagnosis; i++) {
82 auto hwu_pt = make_unique<KBHardWiredUnit>();
83 hwu_pt->readInfoFromFile(fin);
84 hard_wired_diagnosis.push_back(std::move(hwu_pt));
85 }
86 fin.close();
87 // initialize mental belief confidence (i.e., for state = sim::None)
88 for (mental_belief_itr = hard_wired_diagnosis.begin(); mental_belief_itr != hard_wired_diagnosis.end();
89 mental_belief_itr++) {
90 // add mental beliefs to memory and initialize state of activation to sim::None
91 auto mental_belief_sp = make_shared<ExpectedMentalBelief>();
92 mental_belief_sp->setInfoName(mental_belief_itr->get()->getInfoName());
93 mental_belief_sp->setStateOfActivation(sim::None);
94 _perceived_info.mental_belief.push_back(mental_belief_sp);
95 //
96 // update hard wired diagnosis confidence level for mental beliefs
97 this->KBcheckHardWiredMatchForMentalBelief(mental_belief_itr->get()->getInfoName(), sim::None);
98 }
99 }
100 }
101}
102
103void KB::readIndicatorBiasFactors(int _operator) {
104 string str, file_name;
105 int n_bias_factors;
106 bool got_operator = true;
107 //
108 if (_operator == sim::Operator::ODM) {
109 file_name = g_sim.SScheduler.getODMDirectory();
110 file_name += "KB_ODM_Bias_Factors.txt";
111 } else if (_operator == sim::Operator::OCT) {
112 file_name = g_sim.SScheduler.getOCTDirectory();
113 file_name += "KB_OCT_Bias_Factors.txt";
114 } else if (_operator == sim::Operator::OAT) {
115 file_name = g_sim.SScheduler.getOATDirectory();
116 file_name += "KB_OAT_Bias_Factors.txt";
117 } else {
118 ofstream fout("err messages.txt", ios::app);
119 cout << "KB::readIndicatorBiasFactors: " << _operator << " is not one of the three operators." << endl;
120 fout << r5pars_.timesno << " KB::readIndicatorBiasFactors: " << _operator
121 << " is not one of the three operators.\n";
122 fout.close();
123 r5pars_.sim_err = true;
124 g_sim.Branch_center.setTempESMessage("KB::readIndicatorBiasFactors err.");
126 got_operator = false;
127 }
128 if (got_operator) {
129 ifstream fin(file_name.c_str(), ios::in);
130 if (!fin.is_open()) {
131 cout << "File: " << file_name << " cound not be found" << endl;
132 ofstream fout("err messages.txt", ios::app);
133 fout << r5pars_.timesno << " File: " << file_name << " cound not be found\n";
134 fout.close();
135 r5pars_.sim_err = true;
136 g_sim.Branch_center.setTempESMessage("KB::readIndicatorBiasFactors err.");
138 } else {
139 fin >> str >> n_bias_factors;
140 for (int i = 0; i < n_bias_factors; i++) {
141 auto bf_pt = make_unique<KBBiasFactorUnit>();
142 bf_pt->readKBBiasFactorUnit(fin);
143 this->indicator_bias_factors.push_back(std::move(bf_pt));
144 }
145 fin.close();
146 }
147 }
148}
149
150void KB::readSystemDecompositionKB(int _operator) {
151 string file_name;
152 string str;
153 char ch;
154 int number_of_functions, function_id;
155 bool instruction_finished = false;
156 bool got_operator = true;
158 decltype(system_decomposition)::iterator sdu_itr;
159
160// map<string, KBSystemDecompositionUnit *>::iterator system_decomposition_map;
161
162 int i;
163 if (_operator == sim::Operator::ODM) {
164 file_name = g_sim.SScheduler.getODMDirectory();
165 file_name += "KB_ODM_System_Decomposition.txt";
166 } else if (_operator == sim::Operator::OCT) {
167 file_name = g_sim.SScheduler.getOCTDirectory();
168 file_name += "KB_OCT_System_Decomposition.txt";
169 } else if (_operator == sim::Operator::OAT) {
170 file_name = g_sim.SScheduler.getOATDirectory();
171 file_name += "KB_OAT_System_Decomposition.txt";
172 } else {
173 ofstream fout("err messages.txt", ios::app);
174 cout << "KB::readSystemDecompositionKB: " << _operator << " is not one of the three operators." << endl;
175 fout << r5pars_.timesno << " KB::readSystemDecompositionKB: " << _operator
176 << " is not one of the three operators.\n";
177 fout.close();
178 r5pars_.sim_err = true;
179 g_sim.Branch_center.setTempESMessage("KB::readSystemDecompositionKB err.");
181 got_operator = false;
182 }
183 if (got_operator) {//read in information and construct Map
184 i = 0;
185 ifstream fin(file_name.c_str(), ios::in);
186 if (!fin.is_open()) {
187 cout << "File: " << file_name << " cound not be found" << endl;
188 ofstream fout("err messages.txt", ios::app);
189 fout << r5pars_.timesno << " File: " << file_name << " cound not be found\n";
190 fout.close();
191 r5pars_.sim_err = true;
192 g_sim.Branch_center.setTempESMessage("KB::readSystemDecompositionKB err.");
194 } else {
195 while (!instruction_finished) {//read instruction inside the quotation marks
196 fin.get(ch);
197 if (ch == '"') {
198 i++;
199 if (i >= 2) instruction_finished = true;
200 }
201 }
202 fin >> str >> number_of_functions;
203 for (int i = 0; i < number_of_functions; i++) {
204 fin >> str >> function_id;
205 system_function_map.insert(sfm_type::value_type(function_id, str));
206 }
207 fin >> str;
208 fin >> str;
209 while (!fin.eof()) {
210 auto sdu_upt = make_unique<KBSystemDecompositionUnit>();
211 sdu_upt->setInfoName(str);
212 sdu_upt->readInfoFromFileIntegrated(fin);
213 system_decomposition.push_back(std::move(sdu_upt));
214 fin >> str;
215 }
216 fin.close();
217 }
218 //Construct map
219 for (sdu_itr = system_decomposition.begin(); sdu_itr != system_decomposition.end(); sdu_itr++) {
220 sdu_pt = sdu_itr->get();
221 system_decomposition_map.insert(sdu_type::value_type(sdu_pt->getInfoName(), sdu_pt));
222 }
223 }
224}
225void KB::KBcheckHardWiredMatchForControl(string _name, double _value) {
226 for (auto& hw_ptr : hard_wired_diagnosis) {
227 hw_ptr->checkForControl(_name, _value);
228 }
229}
230void KB::KBcheckHardWiredMatchForMentalBelief(string _name, int _state) {
231 for (auto& hw_ptr : hard_wired_diagnosis) {
232 hw_ptr->checkForMentalBelief(_name, _state);
233 }
234}
235void KB::KBcheckHardWiredMatchForProcedureActivity(string _name, int _state) {
236 for (auto& hw_ptr : hard_wired_diagnosis) {
237 hw_ptr->checkForProcedureActivity(_name, _state);
238 }
239}
240void KB::KBcheckHardWiredMatchForAlarmState(string _alarm_name, int _alarm_state) {
241 for (auto& hw_ptr : hard_wired_diagnosis) {
242 hw_ptr->checkForAlarmState(_alarm_name, _alarm_state);
243 }
244}
245void KB::KBcheckHardWiredMatchForComponentState(string _comp_name, int _comp_state) {
246 for (auto& hw_ptr : hard_wired_diagnosis) {
247 hw_ptr->checkForComponentState(_comp_name, _comp_state);
248 }
249}
250void KB::KBcheckHardWiredMatchForSupportSystemState(string _ss_name, int _ss_state) {
251 for (auto& hw_ptr : hard_wired_diagnosis) {
252 hw_ptr->checkForSupportSystemState(_ss_name, _ss_state);
253 }
254}
255void KB::KBcheckHardWiredMatchForParameterValue(string _par_name, double _par_value, int _operator) {
256 for (auto& hw_ptr : hard_wired_diagnosis) {
257 hw_ptr->checkForParameterValue(_par_name, _par_value, _operator);
258 }
259}
260void KB::KBcheckHardWiredMatchForParameterTrend(string _par_name, int _par_trend) {
261 for (auto& hw_ptr : hard_wired_diagnosis) {
262 hw_ptr->checkForParameterTrend(_par_name, _par_trend);
263 }
264}
266 for (auto& src : _kb.hard_wired_diagnosis) {
267 auto hwd_pt = make_unique<KBHardWiredUnit>();
268 hwd_pt->copyKBHardWiredUnit(*src);
269 this->hard_wired_diagnosis.push_back(std::move(hwd_pt));
270 }
271 for (auto& src : _kb.indicator_bias_factors) {
272 auto bf_pt = make_unique<KBBiasFactorUnit>();
273 bf_pt->copyKBBiasFactorUnit(*src);
274 this->indicator_bias_factors.push_back(std::move(bf_pt));
275 }
276 for (auto& src : _kb.system_decomposition) {
277 auto sd_pt = make_unique<KBSystemDecompositionUnit>();
278 sd_pt->copyKBSystemDecompositionUnit(*src);
279 auto* raw = sd_pt.get();
280 this->system_decomposition.push_back(std::move(sd_pt));
281 system_decomposition_map.insert(sdu_type::value_type(raw->getInfoName(), raw));
282 }
283 for (auto& sfm : _kb.system_function_map) {
284 this->system_function_map.insert(sfm_type::value_type(sfm.first, sfm.second));
285 }
286}
287void KB::copyKB(KB &_kb) {
288 for (auto& src : _kb.hard_wired_diagnosis) {
289 auto hwd_pt = make_unique<KBHardWiredUnit>();
290 hwd_pt->copyKBHardWiredUnit(*src);
291 this->hard_wired_diagnosis.push_back(std::move(hwd_pt));
292 }
293 for (auto& src : _kb.indicator_bias_factors) {
294 auto bf_pt = make_unique<KBBiasFactorUnit>();
295 bf_pt->copyKBBiasFactorUnit(*src);
296 this->indicator_bias_factors.push_back(std::move(bf_pt));
297 }
298 for (auto& src : _kb.system_decomposition) {
299 auto sd_pt = make_unique<KBSystemDecompositionUnit>();
300 sd_pt->copyKBSystemDecompositionUnit(*src);
301 auto* raw = sd_pt.get();
302 this->system_decomposition.push_back(std::move(sd_pt));
303 system_decomposition_map.insert(sdu_type::value_type(raw->getInfoName(), raw));
304 }
305 for (auto& sfm : _kb.system_function_map) {
306 this->system_function_map.insert(sfm_type::value_type(sfm.first, sfm.second));
307 }
308}
310 system_decomposition.clear();
311 hard_wired_diagnosis.clear();
314 system_function_map.clear();
315}
316void KB::outputHardWiredDiagnosisLabelToFile(string _operator, ofstream &fout) {
317 string str;
318 for (auto& hwu : hard_wired_diagnosis) {
319 str = _operator;
320 str += hwu->getInfoName();
321 fout << '\t' << str;
322 }
323}
325 for (auto& hwu : hard_wired_diagnosis) {
326 fout << "\tConfidence_%";
327 }
328}
330 for (auto& hwd : hard_wired_diagnosis) {
331 hwd->calculateConfidenceLevel();
332 }
333}
334string KB::getProcedureNameOfHWDiagnosis(string _diagnosis) {
335 bool found = false;
336 string procedure_name = "NONE";
337 auto hwd_itr = hard_wired_diagnosis.begin();
338 while (hwd_itr != hard_wired_diagnosis.end() && !found) {
339 if ((*hwd_itr)->getInfoName() == _diagnosis) {
340 found = true;
341 procedure_name = (*hwd_itr)->getProcedureName();
342 }
343 hwd_itr++;
344 }
345 if (!found) {
346 ofstream fout("err messages.txt", ios::app);
347 cout << "KB::getProcedureNameOfHWDiagnosis: could not find Diagnosis: " << _diagnosis
348 << " from Hard Wired Diagnosis list" << endl;
349 fout << r5pars_.timesno << " KB::getProcedureNameOfHWDiagnosis: could not find Diagnosis: " << _diagnosis
350 << " from Hard Wired Diagnosis list\n";
351 fout.close();
352 r5pars_.sim_err = true;
353 g_sim.Branch_center.setTempESMessage("KB::getProcedureNameOfHWDiagnosis err.");
355 }
356 return procedure_name;
357}
358string KB::getStepNameOfHWDiagnosis(string _diagnosis) {
359 bool found = false;
360 string step_name = "NONE";
361 auto hwd_itr = hard_wired_diagnosis.begin();
362 while (hwd_itr != hard_wired_diagnosis.end() && !found) {
363 if ((*hwd_itr)->getInfoName() == _diagnosis) {
364 found = true;
365 step_name = (*hwd_itr)->getStepName();
366 }
367 hwd_itr++;
368 }
369 if (!found) {
370 ofstream fout("err messages.txt", ios::app);
371 cout << "KB::getProcedureNameOfHWDiagnosis: could not find Diagnosis: " << _diagnosis
372 << " from Hard Wired Diagnosis list" << endl;
373 fout << r5pars_.timesno << " KB::getProcedureNameOfHWDiagnosis: could not find Diagnosis: " << _diagnosis
374 << " from Hard Wired Diagnosis list\n";
375 fout.close();
376 r5pars_.sim_err = true;
377 g_sim.Branch_center.setTempESMessage("KB::getStepNameOfHWDiagnosis err.");
379 }
380 return step_name;
381}
382
384 map<int, string>::iterator sfm_itr;
385 string function = "NONE";
386 sfm_itr = system_function_map.find(_function_id);
387 if (sfm_itr != system_function_map.end()) {
388 function = sfm_itr->second;
389 } else {
390 ofstream fout("err messages.txt", ios::app);
391 cout << "KB::getAssociatedFunctionalDecompositionName: could not find function: " << _function_id
392 << " in System Decomposition" << endl;
393 fout << r5pars_.timesno << " KB::getAssociatedFunctionalDecompositionName: could not find function: "
394 << _function_id << " in System Decomposition\n";
395 fout.close();
396 }
397 return function;
398}
399
401 KBHardWiredUnit *diagnosis_ptr = nullptr;
402 bool found = false;
403 auto hwd_itr = hard_wired_diagnosis.begin();
404 while (hwd_itr != hard_wired_diagnosis.end() && !found) {
405 if ((*hwd_itr)->getInfoName() == _diagnosis) {
406 found = true;
407 diagnosis_ptr = hwd_itr->get();
408 }
409 hwd_itr++;
410 }
411 if (!found) {
412 ofstream fout("err messages.txt", ios::app);
413 cout << r5pars_.timesno << " KB::getPtrToHardWiredDiagnosis: could not find Diagnosis: " << _diagnosis
414 << " from Hard Wired Diagnosis list" << endl;
415 fout << r5pars_.timesno << " KB::getPtrToHardWiredDiagnosis: could not find Diagnosis: " << _diagnosis
416 << " from Hard Wired Diagnosis list\n";
417 fout.close();
418 }
419 return diagnosis_ptr;
420}
421
422double KB::getConfidenceLevelOfHWDiagnosis(string _diagnosis) {
423 bool found = false;
424 double confidence = 0.0;
425 auto hwd_itr = hard_wired_diagnosis.begin();
426 while (hwd_itr != hard_wired_diagnosis.end() && !found) {
427 if ((*hwd_itr)->getInfoName() == _diagnosis) {
428 found = true;
429 confidence = (*hwd_itr)->getConfidenceLevel();
430 }
431 hwd_itr++;
432 }
433 if (!found) {
434 ofstream fout("err messages.txt", ios::app);
435 cout << "KB::getConfidenceLevelOfHWDiagnosis: could not find Diagnosis: " << _diagnosis
436 << " from Hard Wired Diagnosis list" << endl;
437 fout << r5pars_.timesno << " KB::getConfidenceLevelOfHWDiagnosis: could not find Diagnosis: " << _diagnosis
438 << " from Hard Wired Diagnosis list\n";
439 fout.close();
440 }
441 return confidence;
442}
443
444void KB::saveKBToFile(ofstream &fout) {
445 map<int, string>::iterator sfm_itr;
446 int i, num;
447 num = hard_wired_diagnosis.size();
448 fout << "KB\n" << num << '\n';
449 for (i = 0; i < num; i++) {
450 hard_wired_diagnosis.at(i)->saveKBHardWiredUnitToFile(fout);
451 }
452 num = this->indicator_bias_factors.size();
453 fout << "IndicatorBiasFactors " << num << '\n';
454 for (i = 0; i < num; i++) {
455 this->indicator_bias_factors.at(i)->saveKBBiasFactorUnitToFile(fout);
456 }
457 num = system_decomposition.size();
458 fout << "SystemDecomposition " << num << '\n';
459 for (i = 0; i < num; i++) {
460 system_decomposition.at(i)->saveKBSystemDecompositionUnitToFile(fout);
461 }
462 fout << "SystemFunctionMap " << system_function_map.size() << '\n';
463 for (sfm_itr = system_function_map.begin(); sfm_itr != system_function_map.end(); sfm_itr++) {
464 fout << sfm_itr->first << ' ' << sfm_itr->second << '\n';
465 }
466}
467void KB::retrieveKBFromFile(ifstream &fin) {
468 int i, num, function_id;
469 string str, function;
470 fin >> str >> num;
471 if (str != "KB") {
472 ofstream fout("err messages.txt", ios::app);
473 cout << "KB::retrieveKBFromFile File retrieval error in previous function" << endl;
474 fout << r5pars_.timesno << " KB::retrieveKBFromFile File retrieval error in previous function\n";
475 fout.close();
476 r5pars_.sim_err = true;
477 g_sim.Branch_center.setTempESMessage("KB::retrieveKBFromFile Prior error");
479 return;
480 }
481 for (i = 0; i < num; i++) {
482 auto hwd_pt = make_unique<KBHardWiredUnit>();
483 hwd_pt->retrieveKBHardWiredUnitFromFile(fin);
484 hard_wired_diagnosis.push_back(std::move(hwd_pt));
485 }
486 fin >> str >> num;
487 if (str != "IndicatorBiasFactors") {
488 ofstream fout("err messages.txt", ios::app);
489 cout << "KB::retrieveKBFromFile File retrieval error in KBHardWiredUnit" << endl;
490 fout << r5pars_.timesno << " KB::retrieveKBFromFile File retrieval error in KBHardWiredUnit\n";
491 fout.close();
492 r5pars_.sim_err = true;
493 g_sim.Branch_center.setTempESMessage("KB::retrieveKBFromFile in KBHardWiredUnit.");
495 return;
496 }
497 for (i = 0; i < num; i++) {
498 auto bf_pt = make_unique<KBBiasFactorUnit>();
499 bf_pt->retrieveKBBiasFactorUnitFromFile(fin);
500 this->indicator_bias_factors.push_back(std::move(bf_pt));
501 }
502 fin >> str >> num;
503 if (str != "SystemDecomposition") {
504 ofstream fout("err messages.txt", ios::app);
505 cout << "KB::retrieveKBFromFile File retrieval errir in KBHardWiredUnit" << endl;
506 fout << r5pars_.timesno << " KB::retrieveKBFromFile File retrieval errir in KBHardWiredUnit\n";
507 fout.close();
508 r5pars_.sim_err = true;
509 g_sim.Branch_center.setTempESMessage("KB::retrieveKBFromFile in KBHardWiredUnit.");
511 return;
512 }
513 for (i = 0; i < num; i++) {
514 auto sd_pt = make_unique<KBSystemDecompositionUnit>();
515 sd_pt->retrieveKBSystemDecompositionUnitFromFile(fin);
516 system_decomposition.push_back(std::move(sd_pt));
517 }
518 //Construct map
519 for (auto& sdu : system_decomposition) {
520 system_decomposition_map.insert(sdu_type::value_type(sdu->getInfoName(), sdu.get()));
521 }
522 fin >> str >> num;
523 for (i = 0; i < num; i++) {
524 fin >> function_id >> function;
525 system_function_map.insert(sfm_type::value_type(function_id, function));
526 }
527}
528
529
530
531#include <boost/archive/binary_oarchive.hpp>
532#include <boost/archive/binary_iarchive.hpp>
533#include <stdexcept>
534
535void KB::state_save(boost::archive::binary_oarchive& ar) const {
536 const uint32_t n_hw = static_cast<uint32_t>(hard_wired_diagnosis.size());
537 const uint32_t n_bias = static_cast<uint32_t>(indicator_bias_factors.size());
538 ar << n_hw << n_bias;
539 for (const auto& hw : hard_wired_diagnosis) hw->state_save(ar);
540 for (const auto& bf : indicator_bias_factors) bf->timer_state_save(ar);
541 // system_decomposition is pure definition — fully covered by the seed.
542}
543void KB::state_load(boost::archive::binary_iarchive& ar) {
544 uint32_t n_hw = 0, n_bias = 0;
545 ar >> n_hw >> n_bias;
546 if (n_hw != hard_wired_diagnosis.size() || n_bias != indicator_bias_factors.size())
547 throw std::runtime_error("KB state overlay: unit counts mismatch against the seeded KB");
548 for (auto& hw : hard_wired_diagnosis) hw->state_load(ar);
549 for (auto& bf : indicator_bias_factors) bf->timer_state_load(ar);
550}
Knowledge Base — long-term knowledge about plant systems, components, and procedures.
SimulationContext g_sim
Global simulation context: the single instance, defined in SimulationContext.cpp.
void setTempTypeOfConsequence(Consequence)
Stores the consequence of the end state the running sequence will get.
void setTempESMessage(std::string)
Stores the description of the end state the running sequence will get if it is terminated (set by mod...
std::vector< std::shared_ptr< ExpectedMentalBelief > > mental_belief
Definition: InfoChunk.h:149
std::string getInfoName()
Definition: KBElement.cpp:26
Definition: KB.h:46
KB()
Definition: KB.cpp:17
void readHardWiredDiagnosis(int, InfoChunk &)
Definition: KB.cpp:40
void outputHardWiredDiagnosisLabelToFile(std::string, std::ofstream &)
Definition: KB.cpp:316
void copyKB(KB &)
Definition: KB.cpp:287
void clearKB()
Definition: KB.cpp:24
void KBcheckHardWiredMatchForControl(std::string, double)
Definition: KB.cpp:225
void initiationForSimulation(int, InfoChunk &)
Definition: KB.cpp:32
void readSystemDecompositionKB(int)
Definition: KB.cpp:150
void KBcheckHardWiredMatchForProcedureActivity(std::string, int)
Definition: KB.cpp:235
void retrieveKBFromFile(std::ifstream &)
Definition: KB.cpp:467
std::map< std::string, KBSystemDecompositionUnit * > system_decomposition_map
Definition: KB.h:87
std::string getAssociatedFunctionalDecompositionName(int)
Definition: KB.cpp:383
std::map< int, std::string > system_function_map
Definition: KB.h:88
void copyKBForRestart(KB &)
Definition: KB.cpp:265
void KBcheckHardWiredMatchForParameterTrend(std::string, int)
Definition: KB.cpp:260
void clearKBForRestart()
Definition: KB.cpp:309
void state_load(boost::archive::binary_iarchive &ar)
Definition: KB.cpp:543
KBHardWiredUnit * getPtrToHardWiredDiagnosis(std::string)
Definition: KB.cpp:400
void KBcheckHardWiredMatchForAlarmState(std::string, int)
Definition: KB.cpp:240
void saveKBToFile(std::ofstream &)
Definition: KB.cpp:444
void KBcheckHardWiredMatchForParameterValue(std::string, double, int)
Definition: KB.cpp:255
std::vector< std::unique_ptr< KBBiasFactorUnit > > indicator_bias_factors
Definition: KB.h:86
std::string getStepNameOfHWDiagnosis(std::string)
Definition: KB.cpp:358
void KBcalculateHardWiredConfidence()
Definition: KB.cpp:329
void state_save(boost::archive::binary_oarchive &ar) const
Definition: KB.cpp:535
void KBcheckHardWiredMatchForComponentState(std::string, int)
Definition: KB.cpp:245
void outputHardWiredDiagnosisUnitToFile(std::ofstream &)
Definition: KB.cpp:324
std::string getProcedureNameOfHWDiagnosis(std::string)
Definition: KB.cpp:334
void KBcheckHardWiredMatchForSupportSystemState(std::string, int)
Definition: KB.cpp:250
std::vector< std::unique_ptr< KBHardWiredUnit > > hard_wired_diagnosis
Definition: KB.h:84
double getConfidenceLevelOfHWDiagnosis(std::string)
Definition: KB.cpp:422
std::vector< std::unique_ptr< KBSystemDecompositionUnit > > system_decomposition
Definition: KB.h:85
void KBcheckHardWiredMatchForMentalBelief(std::string, int)
Definition: KB.cpp:230
virtual ~KB()
Definition: KB.cpp:21
void readIndicatorBiasFactors(int)
Definition: KB.cpp:103
std::string getOATDirectory()
Definition: Scheduler.cpp:622
std::string getOCTDirectory()
Definition: Scheduler.cpp:625
std::string getODMDirectory()
Definition: Scheduler.cpp:619
struct @0 r5pars_
constexpr int OCT
Definition: SimConstants.h:146
constexpr int ODM
Definition: SimConstants.h:145
constexpr int OAT
Definition: SimConstants.h:144
constexpr int None
Definition: SimConstants.h:75
Scheduler SScheduler
Simulation scheduling, parses CLI options.
BranchRecord Branch_center
Dynamic event tree state.