7#include "../Crew/OperatorDM.h"
8#include "../ControlPanel/ControlPanel.h"
9#include "../Global/SimulationContext.h"
72 this->
m_IB = make_unique<InstantiationBase>();
73 this->
m_MR = make_unique<MentalRepresentation>();
141 for (
auto sent_itr = this->
m_Semantic_list.begin(); sent_itr != this->m_Semantic_list.end() && found ==
false;
143 if ((*sent_itr)->CheckMatchBySentence(_input_sent_pt) ==
true) {
145 sent_pt = sent_itr->get();
156 if ((*state_itr)->m_sent_pt->CheckMatchBySentence(_sent_pt)) {
159 if ((*state_itr)->m_time_range.m_end_time != 0 &&
161 (*state_itr)->m_time_range.m_end_time > state_pt->
m_time_range.
m_end_time) { state_pt = state_itr->get(); }
162 if ((*state_itr)->m_time_range.m_time_before != 0 &&
165 state_pt = state_itr->get();
167 }
else { state_pt = state_itr->get(); }
177 ID_name =
"investigator_" + conv.str();
178 this->m_investigator_number += 1;
179 auto Invest_owned = make_unique<Investigator>();
185 Invest_pt->
m_ID = ID_name;
198 Statement *not_happen_statement_pt = NULL;
200 Statement *found_antonymy_statement_pt = NULL;
202 vector<SentenceUnit *> antonymy_sent_list;
206 vector<IDElement *> antonym_list;
207 vector<IDElement *>::iterator antonym_itr;
212 bool found_antonymy =
false;
213 float start_compare, end_compare;
233 for (antonym_itr = antonym_list.begin(); antonym_itr != antonym_list.end(); antonym_itr++) {
239 case 2: antonymy_sent.
m_state_pt = *antonym_itr;
245 if (found_sent_pt != NULL) { antonymy_sent_list.push_back(found_sent_pt); }
249 for (
auto statement_ritr = this->
m_Statement_list.rbegin(); statement_ritr != this->m_Statement_list.rend();
251 within_range =
false;
254 if ((*statement_ritr)->m_time_range.m_end_time != 0) {
255 end_compare = (*statement_ritr)->m_time_range.m_end_time;
256 }
else if ((*statement_ritr)->m_time_range.m_time_before != 0) {
257 end_compare = (*statement_ritr)->m_time_range.m_time_before;
259 if ((*statement_ritr)->m_time_range.m_start_time != 0) {
260 start_compare = (*statement_ritr)->m_time_range.m_start_time;
261 }
else if ((*statement_ritr)->m_time_range.m_time_after != 0) {
262 start_compare = (*statement_ritr)->m_time_range.m_time_after;
266 if (end_compare >= _start && end_compare <= _end) {
268 }
else if (start_compare >= _start && start_compare <= _end) {
270 }
else if (start_compare <= _start && end_compare >= _end) {
276 if (within_range ==
true) {
277 auto cur_stmt = statement_ritr->get();
278 if (cur_stmt->m_sent_pt == _sent_pt) {
279 if (cur_stmt->m_state ==
true) {
280 if (happen_statement_pt == NULL) {
281 happen_statement_pt = cur_stmt;
283 < cur_stmt->m_time_range.GetTimeBoundLater()) {
284 happen_statement_pt = cur_stmt;
287 if (not_happen_statement_pt == NULL) {
288 not_happen_statement_pt = cur_stmt;
290 < cur_stmt->m_time_range.GetTimeBoundLater()) {
291 not_happen_statement_pt = cur_stmt;
305 }
else if (cur_stmt->m_sent_pt->m_sentence_type == _sent_pt->
m_sentence_type
306 && cur_stmt->m_sent_pt->m_subject_pt == _sent_pt->
m_subject_pt) {
308 for (
auto antonymy_sent_itr = antonymy_sent_list.begin(); antonymy_sent_itr != antonymy_sent_list.end();
309 antonymy_sent_itr++) {
310 if (cur_stmt->m_sent_pt == (*antonymy_sent_itr)) {
311 if (cur_stmt->m_state ==
true) {
312 if (not_happen_statement_pt == NULL) {
313 not_happen_statement_pt = cur_stmt;
315 < cur_stmt->m_time_range.GetTimeBoundLater()) {
316 not_happen_statement_pt = cur_stmt;
319 if (cur_stmt->m_sent_pt->WhetherItIsBiState() ==
true) {
320 if (happen_statement_pt == NULL) {
321 happen_statement_pt = cur_stmt;
323 < cur_stmt->m_time_range.GetTimeBoundLater()) {
324 happen_statement_pt = cur_stmt;
346 antonymy_sent_list.clear();
347 antonym_list.clear();
384 float value1, value2;
385 bool exist_on_CP =
false;
396 if (value_schema_pt == 0) {
return NULL; }
400 if (value_schema_pt == 0) {
return NULL; }
401 }
else {
return NULL; }
406 ID_pt = this->
m_MR->CheckExistenceByConceptStrict(_sent_pt->
m_object_pt);
413 if (value_schema_pt == 0) {
return NULL; }
417 if (value_schema_pt == 0) {
return NULL; }
418 }
else {
return NULL; }
422 }
else {
return NULL; }
425 if (_sent_pt->
m_comparison_pt == this->m_Concept_Base->getBiggerPt()) {
426 if (value1 > value2) { IsTrue =
true; }
427 }
else if (value1 == value2) {
428 if (value1 < value2) { IsTrue =
true; }
429 }
else if (_sent_pt->
m_comparison_pt == this->m_Concept_Base->getEqualPt()) {
430 if (value1 == value2) { IsTrue =
true; }
433 auto new_statement_owned = make_unique<Statement>();
434 new_statement_pt = new_statement_owned.get();
440 new_statement_pt->
m_state = IsTrue;
442 return new_statement_pt;
448 for (
auto KE_itr = this->
m_KE_list.begin(); KE_itr != this->m_KE_list.end() && found ==
false; KE_itr++) {
450 if ((*KE_itr)->m_SentenceUnit_pt->CheckMatchBySentence(statement_pt->
m_sent_pt) ==
true) {
452 if ((*KE_itr)->m_negation ==
false && statement_pt->
m_state ==
true) {
454 found_KE_pt = KE_itr->get();
455 }
else if ((*KE_itr)->m_negation ==
true && statement_pt->
m_state ==
false) {
457 found_KE_pt = KE_itr->get();
472 bool SameContent =
false;
473 float IV_start, IV_end;
476 invest_ritr != this->m_investigator_pool.rend() && found ==
false; invest_ritr++) {
477 if ((*invest_ritr)->m_Statement_pt != 0) {
478 if ((*invest_ritr)->m_Happen == 4) {
continue; }
479 if ((*invest_ritr)->m_Statement_pt->m_sent_pt->CheckMatchBySentence(_KE_pt->
m_SentenceUnit_pt)
481 if ((*invest_ritr)->m_Statement_pt->m_state != _KE_pt->
m_negation) {
483 if ((*invest_ritr)->m_Statement_pt->m_time_range.m_end_time != 0) {
484 IV_end = (*invest_ritr)->m_Statement_pt->m_time_range.m_end_time;
485 }
else if ((*invest_ritr)->m_Statement_pt->m_time_range.m_time_before != 0) {
486 IV_end = (*invest_ritr)->m_Statement_pt->m_time_range.m_end_time;
489 if ((*invest_ritr)->m_Statement_pt->m_time_range.m_start_time != 0) {
490 IV_start = (*invest_ritr)->m_Statement_pt->m_time_range.m_start_time;
491 }
else if ((*invest_ritr)->m_Statement_pt->m_time_range.m_time_after != 0) {
492 IV_start = (*invest_ritr)->m_Statement_pt->m_time_range.m_time_after;
495 if (IV_end >= _start && IV_end <= _end) {
497 found_invest_pt = invest_ritr->get();
498 }
else if (IV_start >= _start && IV_start <= _end) {
500 found_invest_pt = invest_ritr->get();
501 }
else if (IV_start <= _start && IV_end >= _end) {
503 found_invest_pt = invest_ritr->get();
507 }
else if ((*invest_ritr)->m_KElement_ID_pt != 0) {
510 if ((*invest_ritr)->m_Happen == 2 && (*invest_ritr)->m_upperstream_ID_list.size() == 0) {
continue; }
511 if ((*invest_ritr)->m_Happen == 3 && (*invest_ritr)->m_Statement_pt == NULL) {
continue; }
516 if ((*invest_ritr)->m_KElement_ID_pt->m_ID == (_KE_pt->
m_ID)) {
518 if ((*invest_ritr)->m_effective_end >= _start && (*invest_ritr)->m_effective_start <= _end) {
520 found_invest_pt = invest_ritr->get();
521 }
else if ((*invest_ritr)->m_effective_start >= _start && (*invest_ritr)->m_effective_start <= _end) {
523 found_invest_pt = invest_ritr->get();
524 }
else if ((*invest_ritr)->m_effective_start <= _start && (*invest_ritr)->m_effective_end >= _end) {
526 found_invest_pt = invest_ritr->get();
532 return found_invest_pt;
541 bool stay_on_the_current_item =
false;
608 stmt->m_ID_investigator =
"";
609 stmt->m_investigator_ID_pt = NULL;
614 if (this->
m_tbi_A_list.size() > 0 || this->m_tbi_C_list.size() > 0 || this->m_tbi_P_list.size() > 0 || this->m_tbi_SS_list.size() > 0) {
624 stay_on_the_current_item =
true;
661 vector<float>::reverse_iterator fl_ritr;
668 if (
r5pars_.timesno - fl > 30) {
676 - this->m_goofy_start_time))));
681 && this->m_routine_monitor->m_routine_monitor_Token == 11) { this->
NotDoingAnything(); }
691 vector<MentalParameterValue *>::iterator M_P_itr;
692 vector<MentalAlarm *>::iterator M_A_itr;
693 vector<MentalComponentState *>::iterator M_C_itr;
694 vector<MentalSupportSystemState *>::iterator M_SS_itr;
704 bool expecting_indication_bl =
false;
706 string MR_name, CP_name;
707 string indicator_name;
708 vector<string>::iterator str_itr;
709 float perceived_value;
730 if (
r5pars_.timesno > 1347) { MR_P_pt = NULL; }
733 if ((this->
m_tbi_A_list.size() > 0) && this->m_block_alarm_jam ==
false) {
739 if (indicator_name.empty() ==
true) {}
741 ID_pt = this->
m_MR->CheckExistenceByIndicationName(indicator_name);
749 expecting_indication_bl =
true;
782 if (indicator_name ==
"SG_A_NR_Level") { this->
PrintMessage(
""); }
783 if (indicator_name.empty() ==
true) {}
785 ID_pt = this->
m_MR->CheckExistenceByIndicationName(indicator_name);
788 expecting_indication_bl =
true;
834 if (indicator_name.empty() ==
true) {}
836 ID_pt = this->
m_MR->CheckExistenceByIndicationName(indicator_name);
843 expecting_indication_bl =
true;
866 if (indicator_name.empty() ==
true) {}
868 ID_pt = this->
m_MR->CheckExistenceByIndicationName(indicator_name);
875 expecting_indication_bl =
true;
898 if (pu_pt == NULL) {
return; }
903 if (MR_A_pt != NULL) {
906 if (MR_P_pt != NULL) {
909 if (MR_C_pt != NULL) {
912 ID_pt = this->
m_MR->CheckExistenceByConceptName(MR_name);
913 if (ID_pt == NULL) { this->
ErrorMessage(
"Error: could not find a MR unit for a proximity item: " + MR_name); }
917 if (MR_P_pt != NULL) {
967 vector<IDElement *>::reverse_iterator ID_ritr;
968 vector<string>::iterator str_itr;
970 vector<StringTimeIntervalUnit *> recent_lines;
982 int position_in_lines;
983 int largest_position_in_lines = 0;
991 float invest_score, highest_invest_score = 0;
992 float invest_link_score, highest_invest_link_score = 0;
994 float newest_time = 0;
995 float newest_link_time = 0;
998 float invest_time = 0;
1000 bool use_neutral_style =
false;
1001 bool added_bl =
false;
1002 bool use_these_codes =
true;
1004 int thought_line_distance;
1005 int investigation_distance;
1007 int smallest_line_distance = 0;
1008 int smallest_invest_distance = 0;
1010 int smallest_link_line_distance = 0;
1011 int smallest_link_invest_distance = 0;
1016 bool compare_invest_distance;
1017 bool open_to_routine_monitor =
false;
1048 open_to_routine_monitor =
false;
1075 auto line_itr2 = recent_lines.begin();
1076 while (line_itr2 != recent_lines.end() && added_bl ==
false) {
1077 if ((*line_ritr1)->CompareThisUnitWithAnotherStringTimeIntervalUnitOnThoughtLineList(*line_itr2) ==
true) {
1082 if (added_bl ==
false) {
1083 recent_lines.push_back(line_ritr1->get());
1084 if ((*line_ritr1)->m_interrupted_bl ==
true) {
1087 if ((*line_ritr1)->m_interval_end - (*line_ritr1)->m_interval_start > 0) { i++; }
1097 str_itr != this->m_ongoing_item_stack.end() && next_invest_pt == NULL && next_invest_link_pt == NULL;
1100 if (invest_pt != NULL) {
1103 next_invest_pt = invest_pt;
1137 if (next_invest_pt != NULL || next_invest_link_pt != NULL) { use_these_codes =
false; }
1139 use_these_codes =
true;
1140 use_neutral_style =
true;
1142 || this->m_routine_monitor->GetTheLongestIntervalRatio() > 3) {
1143 open_to_routine_monitor =
true;
1154 if (open_to_routine_monitor ==
true && this->
m_routine_monitor->GetTheLongestIntervalRatio() >= 1) {
1171 use_neutral_style =
true;
1175 use_neutral_style =
true;
1186 invest_itr != this->m_unresolved_investigator_pool.end() && use_these_codes ==
true; invest_itr++) {
1187 if ((*invest_itr)->m_ID ==
"Investigator_3") { this->
PrintMessage(
""); }
1189 invest_score = (*invest_itr)->CalculateFilteredPrioritizingScoreOfInvestigator();
1190 if (invest_score == 0) {
continue; }
1206 if ((*invest_itr)->m_ID ==
"Investigator_221") { this->
PrintMessage(
""); }
1216 if ((((*invest_itr)->m_downstream_ID_list.size() == 0 || (*invest_itr)->m_motivation == 1) &&
1218 || ((*invest_itr)->m_investigator_token == 3012
1219 && (*invest_itr)->m_investigator_token_history.size() == 0)) {
1220 invest_time = (*invest_itr)->GetInitiationTimeOrStatementTimeOrLastActiveTime();
1221 if (invest_time > newest_time) {
1222 newest_time = invest_time;
1223 newest_invest_pt = (*invest_itr);
1230 current_invest_pt = (*invest_itr);
1231 newest_invest_in_current_line = current_invest_pt;
1235 auto line_itr2 = recent_lines.begin();
1236 position_in_lines = 0;
1238 while (line_itr2 != recent_lines.end() && position_in_lines == 0) {
1239 if ((*line_itr2)->CheckWhetherContainsAnItemInTheThoughtLine((
IDElement *) (*invest_itr)) ==
true) {
1240 position_in_lines = i;
1246 if (position_in_lines == 1 && current_invest_pt == NULL) {
1247 if (newest_invest_in_current_line == NULL) { newest_invest_in_current_line = *invest_itr; }
1248 else if ((*invest_itr)->GetInitiationTimeOrStatementTimeOrLastActiveTime()
1250 newest_invest_in_current_line = *invest_itr;
1254 if (position_in_lines > largest_position_in_lines) {
1255 largest_position_in_lines = position_in_lines;
1256 invest_in_early_line = *invest_itr;
1257 }
else if (position_in_lines != 0 && position_in_lines == largest_position_in_lines) {
1258 if ((*invest_itr)->GetInitiationTimeOrStatementTimeOrLastActiveTime()
1260 largest_position_in_lines = position_in_lines;
1261 invest_in_early_line = *invest_itr;
1269 if (use_neutral_style ==
false) {
1270 compare_invest_distance =
false;
1273 if (smallest_line_distance == 0) {
1274 if (thought_line_distance > 0 || next_invest_pt == NULL) {
1275 smallest_line_distance = thought_line_distance;
1276 smallest_invest_distance = investigation_distance;
1277 next_invest_pt = (*invest_itr);
1278 highest_invest_score = invest_score;
1279 }
else { compare_invest_distance =
true; }
1281 if (thought_line_distance > 0) {
1282 if (thought_line_distance < smallest_line_distance) {
1283 smallest_link_line_distance = thought_line_distance;
1284 smallest_invest_distance = investigation_distance;
1285 next_invest_pt = (*invest_itr);
1286 highest_invest_score = invest_score;
1287 }
else if (thought_line_distance == smallest_line_distance) { compare_invest_distance =
true; }
1291 if (compare_invest_distance ==
true) {
1292 if (investigation_distance == smallest_invest_distance || next_invest_pt == NULL) {
1293 if (invest_score > highest_invest_score) {
1294 smallest_line_distance = thought_line_distance;
1295 smallest_invest_distance = investigation_distance;
1296 next_invest_pt = (*invest_itr);
1297 highest_invest_score = invest_score;
1299 }
else if (smallest_invest_distance == 0 || investigation_distance < smallest_invest_distance) {
1300 smallest_line_distance = thought_line_distance;
1301 smallest_invest_distance = investigation_distance;
1302 next_invest_pt = (*invest_itr);
1303 highest_invest_score = invest_score;
1309 if (thought_line_distance == 1) {
1311 - this->m_current_thought_line_info->m_interval_start));
1317 if (use_neutral_style ==
true) {
1318 if (invest_score > highest_invest_score) {
1319 next_invest_pt = (*invest_itr);
1320 highest_invest_score = invest_score;
1325 newest_link_time = 0;
1327 invest_link_itr != this->m_investigator_link_pool.end() && use_these_codes ==
true; invest_link_itr++) {
1328 if ((*invest_link_itr)->m_ID ==
"InvestigatorLink_64") { this->
PrintMessage(
"check"); }
1329 if ((*invest_link_itr)->m_forgotten_bl ==
true) {
continue; }
1330 invest_link_score = (*invest_link_itr)->CalculateFilteredPrioritizingScoreOfInvestigatorLink();
1331 if (invest_link_score == 0) {
continue; }
1337 if (invest_link_itr->get() == this->m_working_on_invest_link_pt) {
1338 current_link_pt = invest_link_itr->get();
1339 newest_link_in_current_line = current_link_pt;
1343 auto line_itr2 = recent_lines.begin();
1344 position_in_lines = 0;
1346 while (line_itr2 != recent_lines.end() && position_in_lines == 0) {
1347 if ((*line_itr2)->CheckWhetherContainsAnItemInTheThoughtLine((
IDElement *) invest_link_itr->get()) ==
true) {
1348 position_in_lines = i;
1353 if (position_in_lines == 1 && current_invest_pt == NULL && current_link_pt == NULL) {
1354 if (newest_link_in_current_line != NULL) {
1355 if ((*invest_link_itr)->GetDownstreamInitiationTimeOrStatementTime()
1357 newest_link_in_current_line = invest_link_itr->get();
1359 }
else if (newest_invest_in_current_line != NULL) {
1360 if ((*invest_link_itr)->GetDownstreamInitiationTimeOrStatementTime()
1362 newest_link_in_current_line = invest_link_itr->get();
1364 }
else { newest_link_in_current_line = invest_link_itr->get(); }
1366 if (position_in_lines > largest_position_in_lines) {
1367 largest_position_in_lines = position_in_lines;
1368 link_in_early_line = invest_link_itr->get();
1369 }
else if (position_in_lines != 0 && position_in_lines == largest_position_in_lines) {
1370 if (link_in_early_line != NULL) {
1371 if ((*invest_link_itr)->GetDownstreamInitiationTimeOrStatementTime()
1373 largest_position_in_lines = position_in_lines;
1374 link_in_early_line = invest_link_itr->get();
1376 }
else if (invest_in_early_line != NULL) {
1377 if ((*invest_link_itr)->GetDownstreamInitiationTimeOrStatementTime()
1379 largest_position_in_lines = position_in_lines;
1380 link_in_early_line = invest_link_itr->get();
1395 if (use_neutral_style ==
false) {
1396 compare_invest_distance =
false;
1399 if (smallest_link_line_distance == 0) {
1400 if (thought_line_distance > 0 || next_invest_link_pt == NULL) {
1401 smallest_link_line_distance = thought_line_distance;
1402 smallest_link_invest_distance = investigation_distance;
1403 next_invest_link_pt = invest_link_itr->get();
1404 highest_invest_link_score = invest_link_score;
1405 }
else { compare_invest_distance =
true; }
1407 if (thought_line_distance > 0) {
1408 if (thought_line_distance < smallest_link_line_distance) {
1409 smallest_link_line_distance = thought_line_distance;
1410 smallest_link_invest_distance = investigation_distance;
1411 next_invest_link_pt = invest_link_itr->get();
1412 highest_invest_link_score = invest_link_score;
1413 }
else if (thought_line_distance == smallest_link_line_distance) { compare_invest_distance =
true; }
1417 if (compare_invest_distance ==
true) {
1418 if (smallest_link_invest_distance)
1420 if (investigation_distance == smallest_link_invest_distance || next_invest_link_pt == NULL) {
1421 if (invest_link_score > highest_invest_link_score) {
1422 smallest_link_line_distance = thought_line_distance;
1423 smallest_link_invest_distance = investigation_distance;
1424 next_invest_link_pt = invest_link_itr->get();
1425 highest_invest_link_score = invest_link_score;
1427 }
else if (smallest_link_invest_distance == 0 || investigation_distance < smallest_link_invest_distance) {
1428 smallest_link_line_distance = thought_line_distance;
1429 smallest_link_invest_distance = investigation_distance;
1430 next_invest_link_pt = invest_link_itr->get();
1431 highest_invest_link_score = invest_link_score;
1439 if (use_neutral_style ==
true) {
1440 if (invest_link_score > highest_invest_link_score) {
1441 next_invest_link_pt = invest_link_itr->get();
1442 highest_invest_link_score = invest_link_score;
1462 bool move_to_next =
true;
1464 open_to_routine_monitor =
false;
1466 next_invest_pt = NULL;
1467 next_invest_link_pt = NULL;
1468 move_to_next =
false;
1471 if (move_to_next ==
true && newest_invest_pt != NULL) {
1473 next_invest_pt = newest_invest_pt;
1474 next_invest_link_pt = NULL;
1475 move_to_next =
false;
1477 > this->m_current_thought_line_info->m_interval_start) {
1478 next_invest_pt = newest_invest_pt;
1479 next_invest_link_pt = NULL;
1480 move_to_next =
false;
1484 if (move_to_next ==
true && (
r5pars_.timesno - this->m_current_thought_line_info->m_interval_start
1485 < this->m_attention_span)) {
1488 if (newest_link_in_current_line != NULL) {
1489 next_invest_pt = NULL;
1490 next_invest_link_pt = newest_link_in_current_line;
1491 move_to_next =
false;
1492 }
else if (newest_invest_in_current_line != NULL) {
1493 next_invest_pt = newest_invest_in_current_line;
1494 next_invest_link_pt = NULL;
1495 move_to_next =
false;
1499 if (move_to_next ==
true) { open_to_routine_monitor =
true; }
1500 if (move_to_next ==
true && newest_invest_pt != NULL) {
1501 next_invest_pt = newest_invest_pt;
1502 next_invest_link_pt = NULL;
1503 move_to_next =
false;
1506 if (move_to_next ==
true && largest_position_in_lines != 0) {
1507 if (link_in_early_line != NULL) {
1508 next_invest_pt = NULL;
1509 next_invest_link_pt = link_in_early_line;
1510 move_to_next =
false;
1512 }
else if (invest_in_early_line != NULL) {
1513 next_invest_pt = invest_in_early_line;
1514 next_invest_link_pt = NULL;
1515 move_to_next =
false;
1519 if (move_to_next ==
true) {
1520 if (newest_link_in_current_line != NULL) {
1521 next_invest_pt = NULL;
1522 next_invest_link_pt = newest_link_in_current_line;
1523 move_to_next =
false;
1524 }
else if (newest_invest_in_current_line != NULL) {
1525 next_invest_pt = newest_invest_in_current_line;
1526 next_invest_link_pt = NULL;
1527 move_to_next =
false;
1532 if (next_invest_link_pt == NULL && next_invest_pt == NULL) {
1542 if (next_invest_link_pt == NULL) { selection = 1; }
1543 else if (next_invest_pt == NULL) { selection = 2; }
1545 if (use_neutral_style ==
true) {
1546 if (highest_invest_score > highest_invest_link_score) { selection = 1; }
1547 else { selection = 2; }
1549 if (newest_time > newest_link_time) { selection = 1; }
1550 else { selection = 2; }
1552 compare_invest_distance =
false;
1553 if (smallest_line_distance == smallest_link_line_distance) { compare_invest_distance =
true; }
1554 else if (smallest_link_line_distance == 0) { selection = 1; }
1555 else if (smallest_line_distance == 0) { selection = 2; }
1556 else if (smallest_line_distance < smallest_link_invest_distance) { selection = 1; }
1557 else if (smallest_line_distance > smallest_link_invest_distance) { selection = 2; }
1559 if (compare_invest_distance ==
true) {
1560 if (smallest_invest_distance == smallest_link_invest_distance) {
1561 if (highest_invest_score > highest_invest_link_score) { selection = 1; }
1562 else { selection = 2; }
1563 }
else if (smallest_invest_distance == 0) { selection = 2; }
1564 else if (smallest_link_invest_distance == 0) { selection = 1; }
1565 else if (smallest_invest_distance < smallest_link_invest_distance) { selection = 1; }
1566 else { selection = 2; }
1568 }
else { this->
ErrorMessage(
"Unrecongnized problem solving style"); }
1571 if (selection == 1) {
1573 conv << highest_invest_score;
1574 this->
WriteAuxInfo(
"Prioritization Score: " + conv.str());
1578 }
else if (selection == 2) {
1580 conv << highest_invest_link_score;
1581 this->
WriteAuxInfo(
"Prioritization Score: " + conv.str());
1591 vector<string>::iterator str_itr;
1594 vector<IDElement *>::iterator ID_itr;
1596 bool exist_bl =
false;
1615 str_itr != this->m_working_on_invest_pt->m_thoughtline_roots_list.end(); str_itr++) {
1652 vector<string>::iterator str_itr;
1663 str_itr != this->m_working_on_invest_link_pt->m_thoughtline_roots_list.end(); str_itr++) {
1694 bool finished =
false;
1695 vector<IDElement *>::iterator ID_itr;
1696 for (ID_itr = this->
m_feedback_stack.begin(); ID_itr != this->m_feedback_stack.end(); ID_itr++) {
1697 if ((*ID_itr) == _ID_pt) {
1720 this->
m_IB->ReadInstantiationBaseFromInputFile();
1724 this->
m_MR->ReadMentalRepresentationtInfoFromInputFile();
1742 this->
m_proximity = make_unique<ProximityModel>();
1744 this->
m_proximity->ReadProximityModelFromInputFile();
1760 string directory, str, str1, str2, str_ID, file_name;
1763 unique_ptr<SentenceUnit> sent_pt;
1764 unique_ptr<SentenceUnit> sent2_pt;
1772 vector<IDElement *> processed_X_list;
1773 vector<IDElement *>::iterator ID_X_itr;
1782 for (
size_t MR_P_idx = 1; MR_P_idx < this->
m_MR->m_MRParameter_list.size(); MR_P_idx++) {
1783 auto &MR_P_pt = this->
m_MR->m_MRParameter_list[MR_P_idx];
1787 if (MR_P_pt->m_Concept_ID_pt->m_ID_Type == 002) {
1791 if (ID_X_pt != NULL) {
1793 for (ID_X_itr = processed_X_list.begin(); ID_X_itr != processed_X_list.end() && for_X_bl ==
true; ID_X_itr++) {
1794 if ((*ID_X_itr) == ID_X_pt) {
1798 if (for_X_bl ==
true) {
1799 processed_X_list.push_back(ID_X_pt);
1803 sent_pt = make_unique<SentenceUnit>();
1804 sent_pt->m_ID = MR_P_pt->m_Concept_ID_pt->m_ID +
"_increase";
1805 sent_pt->m_sentence_type = 1;
1806 sent_pt->m_subject_pt = MR_P_pt->m_Concept_ID_pt;
1810 sent_pt = make_unique<SentenceUnit>();
1811 sent_pt->m_ID = MR_P_pt->m_Concept_ID_pt->m_ID +
"_decrease";
1812 sent_pt->m_sentence_type = 1;
1813 sent_pt->m_subject_pt = MR_P_pt->m_Concept_ID_pt;
1817 sent_pt = make_unique<SentenceUnit>();
1818 sent_pt->m_ID = MR_P_pt->m_Concept_ID_pt->m_ID +
"_stable";
1819 sent_pt->m_sentence_type = 1;
1820 sent_pt->m_subject_pt = MR_P_pt->m_Concept_ID_pt;
1824 if (for_X_bl ==
true) {
1825 sent_pt = make_unique<SentenceUnit>();
1826 sent_pt->m_ID = ID_X_pt->
m_ID +
"_increase";
1827 sent_pt->m_sentence_type = 1;
1828 sent_pt->m_subject_pt = ID_X_pt;
1832 sent_pt = make_unique<SentenceUnit>();
1833 sent_pt->m_ID = ID_X_pt->
m_ID +
"_decrease";
1834 sent_pt->m_sentence_type = 1;
1835 sent_pt->m_subject_pt = ID_X_pt;
1839 sent_pt = make_unique<SentenceUnit>();
1840 sent_pt->m_ID = ID_X_pt->
m_ID +
"_stable";
1841 sent_pt->m_sentence_type = 1;
1842 sent_pt->m_subject_pt = ID_X_pt;
1848 for (
auto &MR_C_pt : this->
m_MR->m_MRComponent_list) {
1851 if (MR_C_pt->m_Concept_ID_pt->m_ID_Type == 002) {
1855 if (ID_X_pt != NULL) {
1857 for (ID_X_itr = processed_X_list.begin(); ID_X_itr != processed_X_list.end() && for_X_bl ==
true; ID_X_itr++) {
1858 if ((*ID_X_itr) == ID_X_pt) {
1862 if (for_X_bl ==
true) {
1863 processed_X_list.push_back(ID_X_pt);
1867 if (MR_C_pt->m_CS_type == 0) {
1868 sent_pt = make_unique<SentenceUnit>();
1869 sent_pt->m_ID = MR_C_pt->m_Concept_ID_pt->m_ID +
"_ON";
1870 sent_pt->m_sentence_type = 2;
1871 sent_pt->m_subject_pt = MR_C_pt->m_Concept_ID_pt;
1875 sent_pt = make_unique<SentenceUnit>();
1876 sent_pt->m_ID = MR_C_pt->m_Concept_ID_pt->m_ID +
"_OFF";
1877 sent_pt->m_sentence_type = 2;
1878 sent_pt->m_subject_pt = MR_C_pt->m_Concept_ID_pt;
1882 sent_pt = make_unique<SentenceUnit>();
1883 sent_pt->m_ID = MR_C_pt->m_Concept_ID_pt->m_ID +
"_turn_on";
1884 sent_pt->m_sentence_type = 1;
1885 sent_pt->m_subject_pt = MR_C_pt->m_Concept_ID_pt;
1889 sent_pt = make_unique<SentenceUnit>();
1890 sent_pt->m_ID = MR_C_pt->m_Concept_ID_pt->m_ID +
"_turn_off";
1891 sent_pt->m_sentence_type = 1;
1892 sent_pt->m_subject_pt = MR_C_pt->m_Concept_ID_pt;
1896 if (for_X_bl ==
true) {
1897 sent_pt = make_unique<SentenceUnit>();
1898 sent_pt->m_ID = ID_X_pt->
m_ID +
"_ON";
1899 sent_pt->m_sentence_type = 2;
1900 sent_pt->m_subject_pt = ID_X_pt;
1904 sent_pt = make_unique<SentenceUnit>();
1905 sent_pt->m_ID = ID_X_pt->
m_ID +
"_OFF";
1906 sent_pt->m_sentence_type = 2;
1907 sent_pt->m_subject_pt = ID_X_pt;
1911 sent_pt = make_unique<SentenceUnit>();
1912 sent_pt->m_ID = ID_X_pt->
m_ID +
"_turn_on";
1913 sent_pt->m_sentence_type = 1;
1914 sent_pt->m_subject_pt = ID_X_pt;
1918 sent_pt = make_unique<SentenceUnit>();
1919 sent_pt->m_ID = ID_X_pt->
m_ID +
"_turn_off";
1920 sent_pt->m_sentence_type = 1;
1921 sent_pt->m_subject_pt = ID_X_pt;
1925 }
else if (MR_C_pt->m_CS_type == 1) {
1926 sent_pt = make_unique<SentenceUnit>();
1927 sent_pt->m_ID = MR_C_pt->m_Concept_ID_pt->m_ID +
"_open_bigger";
1928 sent_pt->m_sentence_type = 1;
1929 sent_pt->m_subject_pt = MR_C_pt->m_Concept_ID_pt;
1933 sent_pt = make_unique<SentenceUnit>();
1934 sent_pt->m_ID = MR_C_pt->m_Concept_ID_pt->m_ID +
"_close_smaller";
1935 sent_pt->m_sentence_type = 1;
1936 sent_pt->m_subject_pt = MR_C_pt->m_Concept_ID_pt;
1937 sent_pt->m_process_pt = this->
m_Concept_Base->getCloseSmallerPt();
1940 if (for_X_bl ==
true) {
1941 sent_pt = make_unique<SentenceUnit>();
1942 sent_pt->m_ID = ID_X_pt->
m_ID +
"_open_bigger";
1943 sent_pt->m_sentence_type = 1;
1944 sent_pt->m_subject_pt = ID_X_pt;
1948 sent_pt = make_unique<SentenceUnit>();
1949 sent_pt->m_ID = ID_X_pt->
m_ID +
"_close_smaller";
1950 sent_pt->m_sentence_type = 1;
1951 sent_pt->m_subject_pt = ID_X_pt;
1952 sent_pt->m_process_pt = this->
m_Concept_Base->getCloseSmallerPt();
1958 for (
auto &MR_SS_pt : this->
m_MR->m_MRSupportSystem_list) {
1961 if (MR_SS_pt->m_Concept_ID_pt->m_ID_Type == 002) {
1965 if (ID_X_pt != NULL) {
1967 for (ID_X_itr = processed_X_list.begin(); ID_X_itr != processed_X_list.end() && for_X_bl ==
true; ID_X_itr++) {
1968 if ((*ID_X_itr) == ID_X_pt) {
1972 if (for_X_bl ==
true) {
1973 processed_X_list.push_back(ID_X_pt);
1977 sent_pt = make_unique<SentenceUnit>();
1978 sent_pt->m_ID = MR_SS_pt->m_Concept_ID_pt->m_ID +
"_ON";
1979 sent_pt->m_sentence_type = 2;
1980 sent_pt->m_subject_pt = MR_SS_pt->m_Concept_ID_pt;
1984 sent_pt = make_unique<SentenceUnit>();
1985 sent_pt->m_ID = MR_SS_pt->m_Concept_ID_pt->m_ID +
"_OFF";
1986 sent_pt->m_sentence_type = 2;
1987 sent_pt->m_subject_pt = MR_SS_pt->m_Concept_ID_pt;
1991 sent_pt = make_unique<SentenceUnit>();
1992 sent_pt->m_ID = MR_SS_pt->m_Concept_ID_pt->m_ID +
"_turn_on";
1993 sent_pt->m_sentence_type = 1;
1994 sent_pt->m_subject_pt = MR_SS_pt->m_Concept_ID_pt;
1998 sent_pt = make_unique<SentenceUnit>();
1999 sent_pt->m_ID = MR_SS_pt->m_Concept_ID_pt->m_ID +
"_turn_off";
2000 sent_pt->m_sentence_type = 1;
2001 sent_pt->m_subject_pt = MR_SS_pt->m_Concept_ID_pt;
2005 if (for_X_bl ==
true) {
2006 sent_pt = make_unique<SentenceUnit>();
2007 sent_pt->m_ID = ID_X_pt->
m_ID +
"_ON";
2008 sent_pt->m_sentence_type = 2;
2009 sent_pt->m_subject_pt = ID_X_pt;
2013 sent_pt = make_unique<SentenceUnit>();
2014 sent_pt->m_ID = ID_X_pt->
m_ID +
"_OFF";
2015 sent_pt->m_sentence_type = 2;
2016 sent_pt->m_subject_pt = ID_X_pt;
2020 sent_pt = make_unique<SentenceUnit>();
2021 sent_pt->m_ID = ID_X_pt->
m_ID +
"_turn_on";
2022 sent_pt->m_sentence_type = 1;
2023 sent_pt->m_subject_pt = ID_X_pt;
2027 sent_pt = make_unique<SentenceUnit>();
2028 sent_pt->m_ID = ID_X_pt->
m_ID +
"_turn_off";
2029 sent_pt->m_sentence_type = 1;
2030 sent_pt->m_subject_pt = ID_X_pt;
2036 for (
auto &MR_A_pt : this->
m_MR->m_MRAlarm_list) {
2039 if (MR_A_pt->m_Concept_pt->m_ID_Type == 002) {
2043 if (ID_X_pt != NULL) {
2045 for (ID_X_itr = processed_X_list.begin(); ID_X_itr != processed_X_list.end() && for_X_bl ==
true; ID_X_itr++) {
2046 if ((*ID_X_itr) == ID_X_pt) {
2050 if (for_X_bl ==
true) {
2051 processed_X_list.push_back(ID_X_pt);
2055 sent_pt = make_unique<SentenceUnit>();
2056 sent_pt->m_ID = MR_A_pt->m_Concept_pt->m_ID +
"_turn_on";
2057 sent_pt->m_sentence_type = 1;
2058 sent_pt->m_subject_pt = MR_A_pt->m_Concept_pt;
2062 sent_pt = make_unique<SentenceUnit>();
2063 sent_pt->m_ID = MR_A_pt->m_Concept_pt->m_ID +
"_turn_off";
2064 sent_pt->m_sentence_type = 1;
2065 sent_pt->m_subject_pt = MR_A_pt->m_Concept_pt;
2069 sent_pt = make_unique<SentenceUnit>();
2070 sent_pt->m_ID = MR_A_pt->m_Concept_pt->m_ID +
"_ON";
2071 sent_pt->m_sentence_type = 2;
2072 sent_pt->m_subject_pt = MR_A_pt->m_Concept_pt;
2076 sent_pt = make_unique<SentenceUnit>();
2077 sent_pt->m_ID = MR_A_pt->m_Concept_pt->m_ID +
"_OFF";
2078 sent_pt->m_sentence_type = 2;
2079 sent_pt->m_subject_pt = MR_A_pt->m_Concept_pt;
2083 if (for_X_bl ==
true) {
2084 sent_pt = make_unique<SentenceUnit>();
2085 sent_pt->m_ID = ID_X_pt->
m_ID +
"_turn_on";
2086 sent_pt->m_sentence_type = 1;
2087 sent_pt->m_subject_pt = ID_X_pt;
2091 sent_pt = make_unique<SentenceUnit>();
2092 sent_pt->m_ID = ID_X_pt->
m_ID +
"_turn_off";
2093 sent_pt->m_sentence_type = 1;
2094 sent_pt->m_subject_pt = ID_X_pt;
2098 sent_pt = make_unique<SentenceUnit>();
2099 sent_pt->m_ID = ID_X_pt->
m_ID +
"_ON";
2100 sent_pt->m_sentence_type = 2;
2101 sent_pt->m_subject_pt = ID_X_pt;
2105 sent_pt = make_unique<SentenceUnit>();
2106 sent_pt->m_ID = ID_X_pt->
m_ID +
"_OFF";
2107 sent_pt->m_sentence_type = 2;
2108 sent_pt->m_subject_pt = ID_X_pt;
2118 file_name +=
"KB_ODM_Semantic_Base.txt";
2122 file_name +=
"KB_OAT_Semantic_Base.txt";
2124 err_mes =
"unable to identify operator type in ReasonMachine::ReadSemanticSentencesFromInputFile()";
2130 fin.open(file_name.c_str(), ios::in);
2131 if (!fin.is_open()) {
2132 err_mes =
"could not open the file: " + file_name;
2139 fin >> str >> n_Unit;
2140 if (str.compare(
"No_of_Type_1_Semantic_Sentences") != 0) {
2141 err_mes =
"format error in " + file_name +
"Location: ReasonMachine::ReadSemanticSentencesFromInputFile()";
2143 err_mes +=
"No_of_Type_1_Semantic_Sentences is not aligned";
2147 for (i = 0; i < n_Unit; i++) {
2148 sent_pt = make_unique<SentenceUnit>();
2149 fin >> str >> str_ID;
2151 err_mes =
"Sentence: " + str_ID +
" already exists! use a different ID name!";
2155 sent_pt->m_ID = str_ID;
2156 sent_pt->m_sentence_type = 1;
2161 if (ID_pt == NULL) {
2162 err_mes =
"can not find " + str +
"Location: ReasonMachine::ReadSemanticSentencesFromInputFile()";
2165 }
else { sent_pt->m_subject_pt = ID_pt; }
2170 if (ID_pt == NULL) {
2171 err_mes =
"can not find " + str +
"Location: ReasonMachine::ReadSemanticSentencesFromInputFile()";
2175 sent_pt->m_process_pt = ID_pt;
2180 Inst_pt = this->
m_IB->CheckExistanceOfInstantiationGroupByIndefiniteConceptName(sent_raw->
m_subject_pt->
m_ID);
2181 if (Inst_pt != NULL) {
2183 sent2_pt = make_unique<SentenceUnit>();
2184 sent2_pt->CopyFromAnotherSentence(sent_raw);
2185 sent2_pt->m_subject_pt = (
IDElement *) (*CC_itr);
2194 fin >> str >> n_Unit;
2195 if (str.compare(
"No_of_Type_2_Semantic_Sentences") != 0) {
2196 err_mes =
"format error in " + file_name +
"Location: ReasonMachine::ReadSemanticSentencesFromInputFile()";
2198 err_mes +=
"No_of_Type_2_Semantic_Sentences is not aligned";
2202 for (i = 0; i < n_Unit; i++) {
2203 sent_pt = make_unique<SentenceUnit>();
2204 fin >> str >> str_ID;
2206 err_mes =
"Sentence: " + str_ID +
" already exists! use a different ID name!";
2210 sent_pt->m_ID = str_ID;
2211 sent_pt->m_sentence_type = 2;
2216 if (ID_pt == NULL) {
2217 err_mes =
"can not find " + str +
"Location: ReasonMachine::ReadSemanticSentencesFromInputFile()";
2220 }
else { sent_pt->m_subject_pt = ID_pt; }
2225 if (ID_pt == NULL) {
2226 err_mes =
"can not find " + str +
"Location: ReasonMachine::ReadSemanticSentencesFromInputFile()";
2229 }
else { sent_pt->m_state_pt = ID_pt; }
2232 Inst_pt = this->
m_IB->CheckExistanceOfInstantiationGroupByIndefiniteConceptName(sent_raw->
m_subject_pt->
m_ID);
2233 if (Inst_pt != NULL) {
2235 sent2_pt = make_unique<SentenceUnit>();
2236 sent2_pt->CopyFromAnotherSentence(sent_raw);
2237 sent2_pt->m_subject_pt = (
IDElement *) (*CC_itr);
2238 sent2_pt->m_ID = sent2_pt->m_subject_pt->m_ID +
"_" + sent2_pt->m_state_pt->m_ID;
2244 fin >> str >> n_Unit;
2245 if (str.compare(
"No_of_Type_3_Semantic_Sentences") != 0) {
2246 err_mes =
"format error in " + file_name +
"Location: ReasonMachine::ReadSemanticSentencesFromInputFile()";
2248 err_mes +=
"No_of_Type_3_Semantic_Sentences is not aligned";
2252 for (i = 0; i < n_Unit; i++) {
2253 sent_pt = make_unique<SentenceUnit>();
2254 fin >> str >> str_ID;
2256 err_mes =
"Sentence: " + str_ID +
" already exists! use a different ID name!";
2260 sent_pt->m_ID = str_ID;
2261 sent_pt->m_sentence_type = 3;
2266 if (ID_pt == NULL) {
2267 err_mes =
"can not find " + str +
"Location: ReasonMachine::ReadSemanticSentencesFromInputFile()";
2270 }
else { sent_pt->m_subject_pt = ID_pt; }
2275 if (ID_pt == NULL) {
2276 err_mes =
"can not find " + str +
"Location: ReasonMachine::ReadSemanticSentencesFromInputFile()";
2279 }
else { sent_pt->m_comparison_pt = ID_pt; }
2282 fin >> sent_pt->m_value;
2285 Inst_pt = this->
m_IB->CheckExistanceOfInstantiationGroupByIndefiniteConceptName(sent_raw->
m_subject_pt->
m_ID);
2286 if (Inst_pt != NULL) {
2288 sent2_pt = make_unique<SentenceUnit>();
2289 sent2_pt->CopyFromAnotherSentence(sent_raw);
2290 sent2_pt->m_subject_pt = (
IDElement *) (*CC_itr);
2292 conv << sent2_pt->m_value;
2293 sent2_pt->m_ID = sent2_pt->m_subject_pt->m_ID +
"_" + sent2_pt->m_comparison_pt->m_ID +
"_" + conv.str();
2300 fin >> str >> n_Unit;
2301 if (str.compare(
"No_of_Type_4_Semantic_Sentences") != 0) {
2302 err_mes =
"format error in " + file_name +
"Location: ReasonMachine::ReadSemanticSentencesFromInputFile()";
2304 err_mes +=
"No_of_Type_4_Semantic_Sentences is not aligned";
2308 for (i = 0; i < n_Unit; i++) {
2309 sent_pt = make_unique<SentenceUnit>();
2310 fin >> str >> str_ID;
2312 err_mes =
"Sentence: " + str_ID +
" already existed!";
2316 sent_pt->m_ID = str_ID;
2317 sent_pt->m_sentence_type = 4;
2322 if (ID_pt == NULL) {
2323 err_mes =
"can not find" + str +
"Location: ReasonMachine::ReadSemanticSentencesFromInputFile()";
2326 }
else { sent_pt->m_subject_pt = ID_pt; }
2331 if (ID_pt == NULL) {
2332 err_mes =
"can not find" + str +
"Location: ReasonMachine::ReadSemanticSentencesFromInputFile()";
2335 }
else { sent_pt->m_comparison_pt = ID_pt; }
2340 if (ID_pt == NULL) {
2341 err_mes =
"can not find " + str +
"Location: ReasonMachine::ReadSemanticSentencesFromInputFile()";
2344 }
else { sent_pt->m_object_pt = ID_pt; }
2346 fin >> sent_pt->m_delta_value;
2350 Inst_pt = this->
m_IB->CheckExistanceOfInstantiationGroupByIndefiniteConceptName(sent_raw->
m_subject_pt->
m_ID);
2351 Inst_obj_pt = this->
m_IB->CheckExistanceOfInstantiationGroupByIndefiniteConceptName(sent_raw->
m_object_pt->
m_ID);
2352 if (Inst_pt != NULL && Inst_obj_pt == NULL) {
2354 sent2_pt = make_unique<SentenceUnit>();
2355 sent2_pt->CopyFromAnotherSentence(sent_raw);
2356 sent2_pt->m_subject_pt = (
IDElement *) (*CC_itr);
2358 sent2_pt->m_subject_pt->m_ID +
"_" + sent2_pt->m_comparison_pt->m_ID +
"_" + sent2_pt->m_object_pt->m_ID;
2361 }
else if (Inst_pt == NULL && Inst_obj_pt != NULL) {
2364 sent2_pt = make_unique<SentenceUnit>();
2365 sent2_pt->CopyFromAnotherSentence(sent_raw);
2366 sent2_pt->m_object_pt = (
IDElement *) (*CC_obj_itr);
2368 sent2_pt->m_subject_pt->m_ID +
"_" + sent2_pt->m_comparison_pt->m_ID +
"_" + sent2_pt->m_object_pt->m_ID;
2371 }
else if (Inst_pt != NULL && Inst_obj_pt != NULL) {
2375 sent2_pt = make_unique<SentenceUnit>();
2381 sent2_pt->CopyFromAnotherSentence(sent_raw);
2382 sent2_pt->m_subject_pt = (
IDElement *) (*CC_itr);
2383 sent2_pt->m_object_pt = (
IDElement *) (*CC_obj_itr);
2384 sent2_pt->
m_ID = sent2_pt->m_subject_pt->m_ID +
"_" + sent2_pt->m_comparison_pt->m_ID +
"_"
2385 + sent2_pt->m_object_pt->m_ID;
2390 err_mes = (*CC_itr)->m_ID +
" could not find a matching objective in " + sent_raw->
m_ID;
2400 sent2_pt = make_unique<SentenceUnit>();
2401 sent2_pt->CopyFromAnotherSentence(sent_raw);
2402 sent2_pt->m_subject_pt = (
IDElement *) (*CC_itr);
2403 sent2_pt->m_object_pt = (
IDElement *) (*CC_obj_itr);
2404 sent2_pt->m_ID = sent2_pt->m_subject_pt->m_ID +
"_" + sent2_pt->m_comparison_pt->m_ID +
"_"
2405 + sent2_pt->m_object_pt->m_ID;
2415 fin >> str >> n_Unit;
2416 if (str.compare(
"No_of_Type_5_Semantic_Sentences") != 0) {
2417 err_mes =
"format error in " + file_name +
"Location: ReasonMachine::ReadSemanticSentencesFromInputFile()";
2419 err_mes +=
"No_of_Type_5_Semantic_Sentences is not aligned";
2424 for (i = 0; i < n_Unit; i++) {
2425 fin >> str >> str_ID;
2427 err_mes =
"Sentence: " + str_ID +
" already exists! use a different ID name!";
2431 sent_pt = make_unique<SentenceUnit>();
2432 sent_pt->m_ID = str_ID;
2433 sent_pt->m_sentence_type = 5;
2438 if (ID_pt == NULL) {
2439 err_mes =
"can not find" + str +
"Location: ReasonMachine::ReadSemanticSentencesFromInputFile()";
2442 }
else { sent_pt->m_subject_pt = ID_pt; }
2447 if (ID_pt == NULL) {
2448 err_mes =
"can not find" + str +
"Location: ReasonMachine::ReadSemanticSentencesFromInputFile()";
2451 }
else { sent_pt->m_attribute_pt = ID_pt; }
2455 Inst_pt = this->
m_IB->CheckExistanceOfInstantiationGroupByIndefiniteConceptName(sent_raw->
m_subject_pt->
m_ID);
2456 if (Inst_pt != NULL) {
2458 sent2_pt = make_unique<SentenceUnit>();
2459 sent2_pt->CopyFromAnotherSentence(sent_raw);
2460 sent2_pt->m_subject_pt = (
IDElement *) (*CC_itr);
2461 sent2_pt->m_ID = sent2_pt->m_subject_pt->m_ID +
"_" + sent2_pt->m_attribute_pt->m_ID;
2471 string directory, str, str1, file_name;
2483 file_name +=
"KB_ODM_Knowledge_Unit_Base.txt";
2487 file_name +=
"KB_ODM_Knowledge_Unit_Base.txt";
2491 fin.open(file_name.c_str(), ios::in);
2492 if (!fin.is_open()) {
2493 err_mes =
"could not open file: " + file_name;
2497 fin >> str >> n_Unit;
2498 if (str.compare(
"Number_of_Knowledge_Unit") != 0) {
2499 err_mes =
"Missing line: Number_of_Knowledge_Unit";
2503 for (i = 0; i < n_Unit; i++) {
2504 auto KU_owned = make_unique<KnowledgeUnit>();
2505 KU_pt = KU_owned.get();
2522 for (
auto sent_itr = this->
m_Semantic_list.begin(); sent_itr != this->m_Semantic_list.end() && found_sent_pt == NULL;
2524 sent_pt = sent_itr->get();
2525 if (sent_pt->
m_ID == _ID) {
2526 found_sent_pt = sent_pt;
2529 return found_sent_pt;
2541 for (
auto sent_itr = this->
m_Semantic_list.begin(); sent_itr != this->m_Semantic_list.end(); sent_itr++) {
2545 for (
auto statement_itr = this->
m_Statement_list.begin(); statement_itr != this->m_Statement_list.end(); statement_itr++) {
2552 for (
auto sent_itr = this->
m_Semantic_list.begin(); sent_itr != this->m_Semantic_list.end(); sent_itr++) {
2553 sent_pt = sent_itr->get();
2569 for (
auto sent_itr = this->
m_Semantic_list.begin(); sent_itr != this->m_Semantic_list.end(); sent_itr++) {
2570 (*sent_itr)->m_old_activation = (*sent_itr)->m_activation;
2581 this->
m_Concept_Base->PropagateActivationFromBasicConceptToComposedConcept();
2582 this->
m_Concept_Base->PropagateActivationAmongComposedConceptBottomUp();
2587 this->
m_Concept_Base->SetAllConceptActivationChangeBackToOneAndCleanTheUpdateList();
2615 vector<MentalAlarm *>::iterator m_A_itr;
2617 string indicator_name;
2620 bool found_expected_one =
false;
2628 alarm_size = conv.str();
2634 while (this->
m_tbi_A_list.size() > this->m_max_length_of_alarms_stack) {
2639 if (indicator_name.empty() ==
true) {}
2640 ID_pt = this->
m_MR->CheckExistenceByIndicationName(indicator_name);
2642 found_expected_one =
true;
2646 rm_aux_info =
"slipped information: ";
2647 rm_aux_info += (*m_A_itr)->getAlarmName();
2648 rm_aux_info +=
": ";
2649 if ((*m_A_itr)->getObservedAlarmState() ==
sim::State::On) { rm_aux_info +=
"ON "; }
2650 else { rm_aux_info +=
"OFF "; }
2651 rm_aux_info += alarm_size;
2655 rm_aux_info += conv.str();
2663 if (found_expected_one ==
true) {
2665 for (i = 0; i < keep_i; i++) { m_A_itr++; }
2687 if (_statement_pt->
m_sent_pt->
m_ID ==
"SG_C_level_>_SG_B_level"
2688 || _statement_pt->
m_sent_pt->
m_ID ==
"SG_C_level_>_SG_A_level") {
2695 ID_name =
"statement_" + conv.str();
2696 _statement_pt->
m_ID = ID_name;
2702 if (ID_name ==
"statement_2472") { this->
PrintMessage(
"Check"); }
2710 prompt =
"A new Statement is generated: ";
2713 prompt =
"A new state is NULL!";
2734 ID_name =
"Investigator_" + conv.str();
2736 if (ID_name ==
"Investigator_159") { this->
PrintMessage(
""); }
2746 _invest_pt->
m_ID = ID_name;
2753 prompt =
"A new investigator is generated";
2754 cout <<
"Time: " <<
r5pars_.timesno <<
": " << prompt <<
" ";
2757 ofstream fout(
"RMI.txt", ios::app);
2758 fout <<
"Time: " <<
r5pars_.timesno <<
": " << prompt <<
" ";
2762 prompt =
"To investigate this statement: ";
2763 cout << prompt <<
" ";
2764 ofstream fout(
"RMI.txt", ios::app);
2774 prompt =
"To investigate this Knowledge Element: ";
2776 ofstream fout(
"RMI.txt", ios::app);
2785 rm_aux_info =
"Item forgotten: ";
2786 rm_aux_info += _invest_pt->
m_ID;
2801 prompt =
"The Token of Reasoning Module changed from ";
2807 prompt +=
"now work on this investigator:\n";
2811 prompt +=
"now work on this InvestigatorLink: \n";
2818 vector<Investigator *>::iterator invest_itr;
2823 invest_itr != this->m_unresolved_investigator_pool.end() && found ==
false; invest_itr++) {
2824 if ((*invest_itr) == _invest_pt) {
2838 ID_name =
"InvestigatorLink_" + conv.str();
2839 _link_pt->
m_ID = ID_name;
2843 if (_link_pt->
m_K_unit_pt->
m_ID ==
"KE_MFWP_X_trip_turn_on->KE_MFW_X_flow_decrease") {
2853 string str, ID_name;
2860 for (
auto sent_itr = this->
m_Semantic_list.begin(); sent_itr != this->m_Semantic_list.end(); sent_itr++) {
2861 sent_pt = sent_itr->get();
2862 ID_name =
"KE_" + sent_pt->
m_ID;
2863 auto KE_owned = make_unique<KnowledgeElement>();
2864 KE_pt = KE_owned.get();
2866 KE_pt->
m_ID = ID_name;
2869 this->
m_KE_list.push_back(std::move(KE_owned));
2871 for (
auto sent_itr = this->
m_Semantic_list.begin(); sent_itr != this->m_Semantic_list.end(); sent_itr++) {
2872 sent_pt = sent_itr->get();
2873 ID_name =
"KE_FALSE_" + sent_pt->
m_ID;
2874 auto KE_owned = make_unique<KnowledgeElement>();
2875 KE_pt = KE_owned.get();
2877 KE_pt->
m_ID = ID_name;
2880 this->
m_KE_list.push_back(std::move(KE_owned));
2887 file_name +=
"KB_ODM_Knowledge_Node_Base.txt";
2891 file_name +=
"KB_ODM_Knowledge_Node_Base.txt";
2894 fin.open(file_name.c_str(), ios::in);
2895 if (!fin.is_open()) {
2896 err_mes =
"could not open file: " + file_name;
2917 fin >> str >> n_unit;
2918 if (str.compare(
"Number_of_Knowledge_Node") != 0) {}
2920 for (i = 0; i < n_unit; i++) {
2921 auto KN_owned = make_unique<KnowledgeNode>();
2922 KN_pt = KN_owned.get();
2925 this->
m_KN_list.push_back(std::move(KN_owned));
2934 for (
auto KE_itr = this->
m_KE_list.begin(); KE_itr != this->m_KE_list.end() && found_KE_pt == NULL; KE_itr++) {
2935 if ((*KE_itr)->m_ID == _ID_name) {
2936 found_KE_pt = KE_itr->get();
2945 for (
auto KN_itr = this->
m_KN_list.begin(); KN_itr != this->m_KN_list.end() && found_KN_pt == NULL; KN_itr++) {
2946 if ((*KN_itr)->m_ID == _ID_name) {
2947 found_KN_pt = KN_itr->get();
2954 this->
m_MR->FirstRoundCheckOftheMR();
2959 vector<MentalParameterValue *>::iterator M_P_itr;
2960 vector<MentalAlarm *>::iterator M_A_itr;
2961 vector<MentalComponentState *>::iterator M_C_itr;
2962 vector<MentalSupportSystemState *>::iterator M_SS_itr;
2972 bool expecting_indication_bl =
false;
2974 string indicator_name;
2976 for (M_A_itr = this->
m_tbi_A_list.begin(); M_A_itr != this->m_tbi_A_list.end(); M_A_itr++) {
2980 if (indicator_name.empty() ==
true) {
2981 cout <<
"Indicator name does not exist: " << indicator_name << endl;
2984 ID_pt = this->
m_MR->CheckExistenceByIndicationName(indicator_name);
2985 if (ID_pt != NULL) {
3004 if (indicator_name.empty() ==
true) {
3005 cout <<
"Indicator name does not exist: " << indicator_name << endl;
3008 ID_pt = this->
m_MR->CheckExistenceByIndicationName(indicator_name);
3009 if (ID_pt != NULL) {
3040 if (indicator_name.empty() ==
true) {}
3042 ID_pt = this->
m_MR->CheckExistenceByIndicationName(indicator_name);
3043 if (ID_pt != NULL) {
3057 M_SS_pt = *M_SS_itr;
3061 if (indicator_name.empty() ==
true) {}
3063 ID_pt = this->
m_MR->CheckExistenceByIndicationName(indicator_name);
3064 if (ID_pt != NULL) {
3076 cout <<
r5pars_.timesno <<
" " << str <<
" in ReasonMachine.cpp" <<
'\n';
3077 ofstream fout(
"err messages.txt", ios::app);
3078 fout <<
r5pars_.timesno <<
" " << str <<
'\n';
3090 ID_name =
"KnowledgeUnit_" + conv.str();
3095 cout <<
"Time: " <<
r5pars_.timesno <<
": " << str <<
'\n';
3098 ofstream fout(
"RMI.txt", ios::app);
3099 fout <<
"Time: " <<
r5pars_.timesno <<
": " << str <<
'\n';
3104 for (
auto sent_itr = this->
m_Semantic_list.begin(); sent_itr != this->m_Semantic_list.end(); sent_itr++) {
3105 (*sent_itr)->m_change_ratio = 1;
3122 str =
"Unrecognized RM token!";
3135 file_name +=
"RMOutPut/";
3136 file_name +=
"ODM_Semantic_Base.txt";
3137 ofstream fout(file_name.c_str(), ios::out);
3138 vector<SentenceUnit *>::iterator sent_itr;
3139 fout <<
"There are " << this->
m_Semantic_list.size() <<
" sentences in total" <<
'\n';
3140 for (
auto sent_itr = this->
m_Semantic_list.begin(); sent_itr != this->m_Semantic_list.end(); sent_itr++) {
3141 fout << (*sent_itr)->m_ID <<
'\n';
3148 unique_ptr<SentenceUnit> sent_X_owned;
3169 if (sub_X_pt == NULL && obj_X_pt == NULL) {
3172 if (sub_label_pt != NULL && obj_label_pt != NULL && sub_label_pt != obj_label_pt) {
3173 err_mes = _sent_pt->
m_ID +
" belongs to two lable groups which is beyond the current source codes";
3177 sent_X_owned = make_unique<SentenceUnit>();
3178 sent_X_owned->CopyFromAnotherSentence(_sent_pt);
3179 if (sub_X_pt != NULL) {
3180 sent_X_owned->m_subject_pt = (
IDElement *) sub_X_pt;
3182 if (obj_X_pt != NULL) {
3183 sent_X_owned->m_object_pt = (
IDElement *) obj_X_pt;
3186 if (sent_return_pt == NULL) {
3187 err_mes =
"could not find a indefinite sentence for " + _sent_pt->
m_ID;
3191 return sent_return_pt;
3196 vector<KnowledgeElement *>::iterator KE_itr;
3198 for (
auto KE_itr = this->
m_KE_list.begin(); KE_itr != this->m_KE_list.end() && KE_found_pt == NULL; KE_itr++) {
3199 if ((*KE_itr)->m_SentenceUnit_pt == _sent_pt && (*KE_itr)->m_negation == _Neg_bl) {
3200 KE_found_pt = KE_itr->get();
3209 vector<Instantiation *>::iterator inst_itr;
3210 vector<ConceptComposedUnit *>::iterator CC_itr;
3211 bool change_bl =
false;
3224 if (CC_pt1 == NULL && CC_pt2 == NULL) {
3229 for (
auto inst_itr = this->
m_IB->m_instantiation_list.begin(); inst_itr != this->
m_IB->m_instantiation_list.end();
3231 if ((*inst_itr)->m_indefinite_instance_pt == CC_pt1) {
3233 for (
auto CC_itr = (*inst_itr)->m_instance_list.begin(); CC_itr != (*inst_itr)->m_instance_list.end(); CC_itr++) {
3234 if ((*CC_itr)->m_label_ID_pt == label_ID_pt)
3238 if ((*inst_itr)->m_indefinite_instance_pt == CC_pt2) {
3240 for (
auto CC_itr = (*inst_itr)->m_instance_list.begin(); CC_itr != (*inst_itr)->m_instance_list.end(); CC_itr++) {
3241 if ((*CC_itr)->m_label_ID_pt == label_ID_pt)
3246 if (change_bl ==
false) {
3250 if (sent_found_pt == NULL) {
3251 this->
ErrorMessage(
"could not find the instance sentence");
3254 return sent_found_pt;
3265 vector<KnowledgeElement *>::iterator KE_itr;
3269 Label *label_group_pt;
3270 vector<IDElement *>::iterator ID_itr;
3275 if (KE_starting_pt == NULL) {
3280 if (sent_pt != NULL) {
3284 for (
auto KU_itr = this->
m_Knowledge_list.begin(); KU_itr != this->m_Knowledge_list.end(); KU_itr++) {
3285 if ((*KU_itr)->m_accessable_bl ==
false) {
continue; }
3289 if ((*KU_itr)->m_inference_type == 1 || (*KU_itr)->m_inference_type == 3) {
3294 if ((*KU_itr)->m_Ancestor_pt->m_ID_Type == 401) {
3296 if (KE_pt == KE_starting_pt) {
3298 }
else if (KE_pt == KE_starting_X_pt) {
3301 }
else if ((*KU_itr)->m_Ancestor_pt->m_ID_Type == 402) {
3305 if ((*KE_itr) == KE_starting_pt) {
3314 label_group_pt = this->
m_IB->CheckWhetherASentenceContainIndefiniteItem(KE_buffer_pt->
m_SentenceUnit_pt);
3315 if (label_group_pt != NULL) {
3319 if (sent_pt == NULL) {
3323 {
auto stmt_owned = make_unique<Statement>();
3324 new_statement_pt = stmt_owned.get();
3335 this->
m_MR->UpdateMRwithNewInference(new_statement_pt);
3341 {
auto invest_owned = make_unique<Investigator>();
3342 invest_pt = invest_owned.get();
3343 invest_pt->
m_note =
"by a statement";
3356 {
auto stmt_owned = make_unique<Statement>();
3357 new_statement_pt = stmt_owned.get();
3369 this->
m_MR->UpdateMRwithNewInference(new_statement_pt);
3374 {
auto invest_owned = make_unique<Investigator>();
3375 invest_pt = invest_owned.get();
3376 invest_pt->
m_note =
"by a statement";
3388 }
else if (match == 2) {
3390 sent_pt = this->InstantiateAnIndefiniteSentenceWithLabel(KE_buffer_pt->
m_SentenceUnit_pt, label_ID_pt);
3391 if (sent_pt == NULL) {
3394 {
auto stmt_owned = make_unique<Statement>();
3395 new_statement_pt = stmt_owned.get();
3407 this->
m_MR->UpdateMRwithNewInference(new_statement_pt);
3411 {
auto invest_owned = make_unique<Investigator>();
3412 invest_pt = invest_owned.get();
3413 invest_pt->
m_note =
"by a statement";
3427 if ((*KU_itr)->m_inference_type == 2 || (*KU_itr)->m_inference_type == 3) {
3431 if ((*KU_itr)->m_Ancestor_pt->m_ID_Type == 401) {
3432 if (KE_pt == KE_starting_pt) {
3434 label_group_pt = this->m_IB->CheckWhetherASentenceContainIndefiniteItem(KE_buffer_pt->
m_SentenceUnit_pt);
3435 if (label_group_pt != NULL) {
3439 if (sent_pt == NULL) {
3443 {
auto stmt_owned = make_unique<Statement>();
3444 new_statement_pt = stmt_owned.get();
3456 this->
m_MR->UpdateMRwithNewInference(new_statement_pt);
3460 {
auto invest_owned = make_unique<Investigator>();
3461 invest_pt = invest_owned.get();
3462 invest_pt->
m_note =
"by a statement";
3475 {
auto stmt_owned = make_unique<Statement>();
3476 new_statement_pt = stmt_owned.get();
3488 this->
m_MR->UpdateMRwithNewInference(new_statement_pt);
3492 {
auto invest_owned = make_unique<Investigator>();
3493 invest_pt = invest_owned.get();
3494 invest_pt->
m_note =
"by a statement";
3506 }
else if (KE_pt == KE_starting_X_pt) {
3508 sent_pt = this->InstantiateAnIndefiniteSentenceWithLabel(KE_buffer_pt->
m_SentenceUnit_pt, label_ID_pt);
3509 if (sent_pt == NULL) {
3512 {
auto stmt_owned = make_unique<Statement>();
3513 new_statement_pt = stmt_owned.get();
3525 this->
m_MR->UpdateMRwithNewInference(new_statement_pt);
3528 auto invest_owned = make_unique<Investigator>();
3529 invest_pt = invest_owned.get();
3530 invest_pt->
m_note =
"by a statement";
3542 }
else if ((*KU_itr)->m_Ancestor_pt->m_ID_Type == 402) {
3550 string dir_path, statement_path, invest_path, MR_path, esb_path, link_path, history_path, dynamic_path,
3551 thought_line_path, activation_path;
3560 dir_path +=
"RMOutPut/";
3561 statement_path = dir_path +
"ODM_statements_" + conv.str() +
".txt";
3562 invest_path = dir_path +
"ODM_investigations_" + conv.str() +
".txt";
3563 MR_path = dir_path +
"ODM_MentalRepresentation_" + conv.str() +
".txt";
3564 esb_path = dir_path +
"ODM_DiagnoseInvestigation_" + conv.str() +
".txt";
3565 link_path = dir_path +
"ODM_InvestigationLink_" + conv.str() +
".txt";
3566 history_path = dir_path +
"ODM_History_" + conv.str() +
".txt";
3567 dynamic_path = dir_path +
"ODM_PSF_Dynamic_Parameter_History_" + conv.str() +
".txt";
3568 thought_line_path = dir_path +
"ODM_thougt_line_history_" + conv.str() +
".txt";
3571 activation_path = dir_path +
"ODM_Activation_" + conv.str() +
".txt";
3578 this->
m_MR->SaveMentalRepresentationInforToFile(MR_path);
3581 this->
m_Concept_Base->SaveConceptActivationIntoOutputFile(activation_path);
3585 vector<Statement *>::iterator statement_itr;
3588 ofstream fout(_path.c_str(), ios::out);
3589 for (
auto statement_itr = this->
m_Statement_list.begin(); statement_itr != this->m_Statement_list.end(); statement_itr++) {
3590 statement_pt = statement_itr->get();
3592 << statement_pt->
m_ID <<
'\t'
3595 if (statement_pt->
m_state ==
true) {
3596 fout <<
"true" <<
'\t';
3598 fout <<
"false" <<
'\t';
3601 fout <<
"confidence: " << statement_pt->
m_confidence <<
'\t';
3619 vector<Investigator *>::iterator invest_itr;
3624 vector<int>::iterator token_itr;
3625 vector<IDElement *>::iterator link_ID_itr;
3626 vector<IDElement *>::iterator invest_ID_itr;
3627 vector<float>::iterator fl_itr;
3629 ofstream fout(_path.c_str(), ios::out);
3634 <<
"Investigator ID" <<
'\t'
3635 <<
"Is a Root" <<
'\t'
3636 <<
"Statement Info" <<
'\t'
3637 <<
"KnowledgeElement Info" <<
'\t'
3638 <<
"Happen or Not" <<
'\t'
3639 <<
"Explained or Not" <<
'\t'
3640 <<
"Investigator Token history" <<
'\t'
3641 <<
"Upperstream Investigators" <<
'\t'
3642 <<
"Derived by" <<
'\t'
3643 <<
"investigation initiate time" <<
'\t'
3644 <<
"investigation cease time" <<
'\t'
3645 <<
"Dormant or Not" <<
'\t'
3646 <<
"Link to SymptomInvestigator" <<
'\t'
3647 <<
"Open status" <<
'\n';
3649 for (
auto invest_itr = this->
m_investigator_pool.begin(); invest_itr != this->m_investigator_pool.end(); invest_itr++) {
3650 invest_pt = invest_itr->get();
3654 fout << invest_pt->
m_ID <<
'\t';
3657 fout <<
"Origin" <<
'\t';
3659 fout <<
"Derived" <<
'\t';
3706 case 1: fout <<
"?";
3708 case 2: fout <<
"U";
3710 case 3: fout <<
"Yes";
3712 case 4: fout <<
"No";
3719 case 1: fout <<
"?";
3721 case 2: fout <<
"U";
3723 case 3: fout <<
"Succeeded";
3725 case 4: fout <<
"Failed";
3740 fout <<
"(" << (*token_itr) <<
"-" << (*fl_itr) <<
") ";
3753 fout << (*invest_ID_itr)->
m_ID <<
": " << invest_buffer_pt->
m_Happen;
3757 fout << invest_pt->
m_note;
3763 else { fout <<
"NONE"; }
3765 else { fout <<
"open"; }
3773 for (
auto KU_itr = this->
m_Knowledge_list.begin(); KU_itr != this->m_Knowledge_list.end() && KU_found_pt == NULL;
3775 if ((*KU_itr)->m_ID == str_ID) {
3776 KU_found_pt = KU_itr->get();
3787 vector<Investigator *>::iterator invest_itr;
3788 vector<InvestigatorLink *>::iterator invest_link_itr;
3791 invest_itr != this->m_unresolved_investigator_pool.end(); invest_itr++) {
3792 (*invest_itr)->m_interest_from_SymptomInvestigator = 0;
3795 invest_link_itr != this->m_investigator_link_pool.end(); invest_link_itr++) {
3796 (*invest_link_itr)->m_interest_from_SymptomInvestigator = 0;
3831 this->
ErrorMessage(
"this->m_investigation_history.size() != 0");
3835 this->
ErrorMessage(
"this->m_thought_line_history.size() != 0");
3841 auto info_owned = make_unique<StringTimeIntervalUnit>();
3842 info_owned->CopyFromAnotherStringTimeIntervalUnit(info_itr->get());
3848 auto info_owned = make_unique<StringTimeIntervalUnit>();
3849 info_owned->CopyFromAnotherStringTimeIntervalUnit(info_itr->get());
3869 this->
m_proximity = make_unique<ProximityModel>();
3897 vector<int>::iterator i_itr;
3898 vector<float>::iterator fl_itr;
3909 vector<ValueTimeLineUnit *>::iterator v_itr;
3913 > 0) { this->
ErrorMessage(
"this->m_max_alarm_length_timeline.size() > 0"); }
3915 this->
ErrorMessage(
"this->m_max_alarm_length_timeline.size() > 0");
3921 auto v_owned = make_unique<ValueTimeLineUnit>();
3922 v_owned->CopyFromAnotherVTLU(v_itr->get());
3926 auto v_owned = make_unique<ValueTimeLineUnit>();
3927 v_owned->CopyFromAnotherVTLU(v_itr->get());
3932 auto v_owned = make_unique<ValueTimeLineUnit>();
3933 v_owned->CopyFromAnotherVTLU(v_itr->get());
3937 auto v_owned = make_unique<ValueTimeLineUnit>();
3938 v_owned->CopyFromAnotherVTLU(v_itr->get());
3942 auto v_owned = make_unique<ValueTimeLineUnit>();
3943 v_owned->CopyFromAnotherVTLU(v_itr->get());
3949 auto v_owned = make_unique<ValueTimeLineUnit>();
3950 v_owned->CopyFromAnotherVTLU(v_itr->get());
3956 auto v_owned = make_unique<ValueTimeLineUnit>();
3957 v_owned->CopyFromAnotherVTLU(v_itr->get());
3961 auto v_owned = make_unique<ValueTimeLineUnit>();
3962 v_owned->CopyFromAnotherVTLU(v_itr->get());
3966 auto v_owned = make_unique<ValueTimeLineUnit>();
3967 v_owned->CopyFromAnotherVTLU(v_itr->get());
3971 auto v_owned = make_unique<ValueTimeLineUnit>();
3972 v_owned->CopyFromAnotherVTLU(v_itr->get());
3977 auto v_owned = make_unique<ValueTimeLineUnit>();
3978 v_owned->CopyFromAnotherVTLU(v_itr->get());
3984 auto v_owned = make_unique<ValueTimeLineUnit>();
3985 v_owned->CopyFromAnotherVTLU(v_itr->get());
3991 auto v_owned = make_unique<ValueTimeLineUnit>();
3992 v_owned->CopyFromAnotherVTLU(v_itr->get());
4000 this->
m_IB->CopyInstantiationBaseFromAnotherIB(_RM_pt->
m_IB.get());
4014 this->
ErrorMessage(
"this->m_Knowledge_list.size() != 0");
4017 auto KU_owned = make_unique<KnowledgeUnit>();
4018 KU_owned->CopyStaticKnowledgeUnitInfoFromAnother(KU_itr->get());
4031 this->
m_MR->CopyMentalRepresentationFromAnother(_RM_pt->
m_MR.get());
4033 vector<Investigator *>::iterator invest_itr;
4037 this->
ErrorMessage(
"if(this->m_investigator_pool.size() != 0");
4042 auto invest_owned = make_unique<Investigator>();
4043 invest_owned->CopyInvestigatorInfoFromAnother(invest_itr->get());
4048 vector<Statement *>::iterator state_itr;
4051 this->
ErrorMessage(
"this->m_Statement_list.size() != 0");
4055 auto state_owned = make_unique<Statement>();
4056 state_owned->CopyStatementInfoFromAnother(state_itr->get());
4061 vector<InvestigatorLink *>::iterator link_itr;
4064 this->
ErrorMessage(
"this->m_investigator_link_pool.size() != 0");
4069 auto link_owned = make_unique<InvestigatorLink>();
4070 link_owned->CopyInvestigatorLinkInfoFromAnother(link_itr->get());
4094 this->
ErrorMessage(
"this->m_ID_unresolved_invest_pool.size() != 0");
4098 this->
ErrorMessage(
"this->m_ID_resolved_invest_pool.size() != 0");
4102 this->
ErrorMessage(
"this->m_ID_succes_invest_pool.size() != 0");
4106 this->
ErrorMessage(
"this->m_ID_failed_invest_pool.size() != 0");
4110 this->
ErrorMessage(
"this->m_ID_undertermined_invest_pool.size() != 0");
4114 this->
ErrorMessage(
"this->m_ID_discarded_invest_pool.size() != 0");
4118 this->
ErrorMessage(
"this->m_ID_cause_undertermined_invest_pool.size() != 0");
4122 this->
ErrorMessage(
"this->m_ID_feedback_stack.size() != 0");
4126 this->
ErrorMessage(
"this->m_ID_invest_trace.size() != 0");
4159 vector<string>::iterator str_itr;
4172 ID = (*invest_itr)->m_ID;
4186 ID = (*invest_itr)->m_ID;
4200 ID = (*invest_itr)->m_ID;
4213 ID = (*invest_itr)->m_ID;
4227 ID = (*invest_itr)->m_ID;
4240 ID = (*invest_itr)->m_ID;
4254 ID = (*invest_itr)->m_ID;
4265 vector<IDElement *>::iterator ID_itr;
4269 ID = (*ID_itr)->m_ID;
4281 ID = (*ID_itr)->m_ID;
4293 ID = (*ID_itr)->m_ID;
4304 this->
ErrorMessage(
"this->m_position_tbi_A_list.size() != 0");
4308 this->
ErrorMessage(
"this->m_position_tbi_C_list.size() != 0");
4312 this->
ErrorMessage(
"this->m_position_tbi_SS_list.size() != 0");
4316 this->
ErrorMessage(
"this->m_position_tbi_P_list.size() != 0");
4333 vector<int>::iterator int_itr;
4336 vector<MentalComponentState *>::iterator mc_itr;
4337 vector<MentalSupportSystemState *>::iterator mss_itr;
4338 vector<MentalAlarm *>::iterator ma_itr;
4339 vector<MentalParameterValue *>::iterator mp_itr;
4425 this->
m_IB->ConvertIBInfoToStringForm();
4428 vector<SentenceUnit *>::iterator sent_itr;
4429 for (
auto sent_itr = this->
m_Semantic_list.begin(); sent_itr != this->m_Semantic_list.end(); sent_itr++) {
4430 (*sent_itr)->ConvertSentenceInfoToStringForm();
4434 vector<KnowledgeElement *>::iterator KE_itr;
4435 for (
auto KE_itr = this->
m_KE_list.begin(); KE_itr != this->m_KE_list.end(); KE_itr++) {
4436 (*KE_itr)->ConvertKEinfoToStringForm();
4440 vector<KnowledgeNode *>::iterator KN_itr;
4441 for (
auto KN_itr = this->
m_KN_list.begin(); KN_itr != this->m_KN_list.end(); KN_itr++) {
4442 (*KN_itr)->ConvertKNinfoToStringForm();
4446 for (
auto KU_itr = this->
m_Knowledge_list.begin(); KU_itr != this->m_Knowledge_list.end(); KU_itr++) {
4447 (*KU_itr)->ConvertKnowledgeLinkInfoToString();
4458 auto sent_pt = make_unique<SentenceUnit>();
4459 sent_pt->CopyStaticInfoFromAnotherSentence(sent_itr->get());
4466 vector<KnowledgeElement *>::iterator KE_itr;
4471 for (
auto KE_itr = _RM_pt->
m_KE_list.begin(); KE_itr != _RM_pt->
m_KE_list.end(); KE_itr++) {
4472 auto KE_owned = make_unique<KnowledgeElement>();
4473 KE_owned->CopyStaticKEinfoFromAnother(KE_itr->get());
4474 this->
m_KE_list.push_back(std::move(KE_owned));
4479 vector<KnowledgeNode *>::iterator KN_itr;
4485 for (
auto KN_itr = _RM_pt->
m_KN_list.begin(); KN_itr != _RM_pt->
m_KN_list.end(); KN_itr++) {
4486 auto KN_owned = make_unique<KnowledgeNode>();
4487 KN_owned->CopyStaticKNinfoFromAnother(KN_itr->get());
4488 this->
m_KN_list.push_back(std::move(KN_owned));
4505 vector<SentenceUnit *>::iterator sent_itr;
4507 sent_itr++) { (*sent_itr)->BuildTheConnectionsToThisSentence((
void *)
this); }
4510 vector<KnowledgeElement *>::iterator KE_itr;
4512 KE_itr++) { (*KE_itr)->BuildTheConnectionsToThisKE((
void *)
this); }
4515 vector<KnowledgeNode *>::iterator KN_itr;
4517 KN_itr++) { (*KN_itr)->BuildConnectionsToThisKN((
void *)
this); }
4521 KU_itr++) { (*KU_itr)->BuildConnectionsToThisKU((
void *)
this); }
4524 this->
m_IB->BuildConnectionsForTheInstantiationBase((
void *)
this);
4529 vector<Statement *>::iterator state_itr;
4531 state_itr++) { (*state_itr)->BuildConnectionsToThisStatement((
void *)
this); }
4535 state_itr++) { (*state_itr)->BuildConnectionsToThisStatement((
void *)
this); }
4539 state_itr++) { (*state_itr)->BuildConnectionsToThisStatement((
void *)
this); }
4542 vector<Investigator *>::iterator invest_itr;
4544 invest_itr++) { (*invest_itr)->BuildTheConnectionsToThisInvestigator((
void *)
this); }
4547 vector<InvestigatorLink *>::iterator link_itr;
4549 link_itr++) { (*link_itr)->BuildConnectionsToThisInvestigatorLink((
void *)
this); }
4551 vector<string>::iterator str_itr;
4558 if (invest_pt == NULL) {
4559 this->
ErrorMessage(
"could not find this investigator " + *str_itr);
4569 if (invest_pt == NULL) {
4570 this->
ErrorMessage(
"could not find this investigator " + *str_itr);
4578 for (str_itr = this->
m_ID_succes_invest_pool.begin(); str_itr != this->m_ID_succes_invest_pool.end(); str_itr++) {
4580 if (invest_pt == NULL) {
4581 this->
ErrorMessage(
"could not find this investigator " + *str_itr);
4589 for (str_itr = this->
m_ID_failed_invest_pool.begin(); str_itr != this->m_ID_failed_invest_pool.end(); str_itr++) {
4591 if (invest_pt == NULL) {
4592 this->
ErrorMessage(
"could not find this investigator " + *str_itr);
4603 if (invest_pt == NULL) {
4604 this->
ErrorMessage(
"could not find this investigator " + *str_itr);
4615 if (invest_pt == NULL) {
4616 this->
ErrorMessage(
"could not find this investigator " + *str_itr);
4625 str_itr != this->m_ID_cause_undertermined_invest_pool.end(); str_itr++) {
4627 if (invest_pt == NULL) {
4628 this->
ErrorMessage(
"could not find this investigator " + *str_itr);
4666 this->
m_MR->BuildConnectionsForMentalRepresentation((
void *)
this);
4673 if (state_pt == NULL) {
4674 this->
ErrorMessage(
"could not find this statement " + *str_itr);
4682 for (str_itr = this->
m_ID_new_statement_list.begin(); str_itr != this->m_ID_new_statement_list.end(); str_itr++) {
4684 if (state_pt == NULL) {
4685 this->
ErrorMessage(
"could not find this statement " + *str_itr);
4694 for (str_itr = this->
m_ID_feedback_stack.begin(); str_itr != this->m_ID_feedback_stack.end(); str_itr++) {
4696 if (ID_pt == NULL) {
4704 for (str_itr = this->
m_decayed_item_ID_list.begin(); str_itr != this->m_decayed_item_ID_list.end(); str_itr++) {
4706 if (ID_pt == NULL) {
4715 for (str_itr = this->
m_ID_invest_trace.begin(); str_itr != this->m_ID_invest_trace.end(); str_itr++) {
4717 if (ID_pt == NULL) {
4740 vector<int>::iterator int_itr;
4791 vector<Investigator *>::iterator invest_itr;
4795 invest_itr != this->m_investigator_pool.end() && found_invest == NULL; invest_itr++) {
4796 if ((*invest_itr)->m_ID == _ID) {
4797 found_invest = invest_itr->get();
4800 return found_invest;
4804 vector<Statement *>::iterator state_itr;
4806 for (
auto state_itr = this->
m_Statement_list.begin(); state_itr != this->m_Statement_list.end() && found_state == NULL;
4808 if ((*state_itr)->m_ID == _ID) { found_state = state_itr->get(); }
4815 vector<InvestigatorLink *>::iterator link_itr;
4818 link_itr != this->m_investigator_link_pool.end() && found_link == NULL; link_itr++) {
4819 if ((*link_itr)->m_ID == _ID) { found_link = link_itr->get(); }
4850 vector<IDElement *>::iterator ID_itr;
4854 ofstream fout(_path.c_str(), ios::out);
4855 fout <<
"ID" <<
'\t' <<
"starting time" <<
'\t' <<
"ending time" <<
'\n';
4856 for (
auto info_itr = this->
m_investigation_history.begin(); info_itr != this->m_investigation_history.end(); info_itr++) {
4857 fout << (*info_itr)->m_name <<
'\t';
4858 fout << (*info_itr)->m_interval_start <<
'\t';
4859 fout << (*info_itr)->m_interval_end <<
'\t';
4860 if ((*info_itr)->m_name.compare(0, 13,
"Investigator_") == 0) {
4862 if (invest_pt == NULL) { fout <<
"error" <<
'\t'; }
4868 }
else if ((*info_itr)->m_name.compare(0, 17,
"InvestigatorLink_") == 0) {
4870 if (link_pt == NULL) { fout <<
"error" <<
'\t'; }
4875 fout << (*ID_itr)->m_ID <<
" , ";
4885 vector<InvestigatorLink *>::iterator link_itr;
4888 vector<int>::iterator int_itr;
4889 vector<IDElement *>::iterator ID_itr;
4892 ofstream fout(_path.c_str(), ios::out);
4894 <<
"Link ID" <<
'\t'
4895 <<
"Path status" <<
'\t'
4896 <<
"Upperstream ID" <<
'\t'
4897 <<
"Downstream ID" <<
'\t'
4898 <<
"Condition ID" <<
'\t'
4899 <<
"Token History" <<
'\t'
4900 <<
"Dormant" <<
'\n';
4903 link_pt = link_itr->get();
4904 fout << link_pt->
m_ID <<
'\t';
4908 fout << invest_pt->
m_ID;
4910 fout << invest_pt->
m_Happen <<
"; ";
4915 if (invest_pt != NULL) {
4916 fout << invest_pt->
m_ID;
4917 fout <<
": " << invest_pt->
m_Happen;
4922 if (invest_pt != NULL) {
4923 fout << invest_pt->
m_ID;
4924 fout <<
": " << invest_pt->
m_Happen;
4942 bool existing =
false;
4943 vector<IDElement *>::iterator ID_itr;
4946 for (ID_itr = this->
m_feedback_stack.begin(); ID_itr != this->m_feedback_stack.end(); ID_itr++) {
4947 if (*ID_itr == _ID_pt) { existing =
true; }
4949 if (existing ==
true) {
return; }
4954 string directory, str, str1, file_name;
4962 file_name +=
"KB_ODM_RM_Profile.txt";
4966 file_name +=
"KB_OAT_RM_Profile.txt";
4970 fin.open(file_name.c_str(), ios::in);
4971 if (!fin.is_open()) {
4972 err_mes =
"could not open file: " + file_name;
4984 if (str.compare(
"Problem_solving_style:") != 0) {
4985 err_mes =
"Missing line: Problem_solving_style:" + file_name +
" " + str;
4990 if (str.compare(
"NEUTRAL") == 0) {
4992 }
else if (str.compare(
"VAGABOND") == 0) {
4998 }
else if (str.compare(
"HAMLET_B") == 0) {
5003 }
else if (str.compare(
"HAMLET") == 0) {
5007 }
else if (str.compare(
"GARDEN_PATH") == 0) {
5012 }
else { this->
ErrorMessage(
"Unrecognized problem solving style!"); }
5015 if (str.compare(
"Initial_fatigue_level:") != 0) {
5016 err_mes =
"Missing line: Initial_fatigue_level:";
5023 if (str.compare(
"Expert_Level:") != 0) {
5024 err_mes =
"Missing line: Expert_Level:";
5065 ofstream fout(_path.c_str(), ios::out);
5066 fout << 14 << n_row + 1 <<
'\n';
5067 fout <<
"Time" <<
'\t'
5068 <<
"PSF_Time_Constraint_Load" <<
'\t'
5069 <<
"PSF_Passive_Alarm_Load" <<
'\t'
5070 <<
"PSF_Cognitive_Load" <<
'\t'
5071 <<
"PSF_Diagnosis_Complexity" <<
'\t'
5072 <<
"PSF_Stress" <<
'\t'
5073 <<
"PSF_Fatigue" <<
'\t'
5075 <<
"Model_Parameter_Max_Alarm_Stack_Length" <<
'\t'
5076 <<
"Model_Parameter_Cognitive_Resouse_Use" <<
'\t'
5077 <<
"Model_Parameter_Cognitive_Time_Cost_Multiplier" <<
'\t'
5078 <<
"Model_Parameter_Routin_Monitor_Interval_Multiplier" <<
'\t'
5079 <<
"Model_Parameter_Attention_Span" <<
'\t'
5080 <<
"Model_Parameter_Memory_Span" <<
'\t'
5081 <<
"Model_Parameter_Investigation_Item_Decay_Time" <<
'\t'
5089 fout << v_pt->
m_time <<
'\t';
5090 fout << v_pt->
m_fl <<
'\t';
5095 fout << v_pt->
m_fl <<
'\t';
5100 fout << v_pt->
m_fl <<
'\t';
5105 fout << v_pt->
m_fl <<
'\t';
5110 fout << v_pt->
m_fl <<
'\t';
5115 fout << v_pt->
m_fl <<
'\t';
5120 fout << v_pt->
m_int <<
'\t';
5125 fout << v_pt->
m_fl <<
'\t';
5130 fout << v_pt->
m_fl <<
'\t';
5135 fout << v_pt->
m_fl <<
'\t';
5140 fout << v_pt->
m_fl <<
'\t';
5145 fout << v_pt->
m_fl <<
'\t';
5150 fout << v_pt->
m_fl <<
'\t';
5173 float perceived_value = 0;
5175 if (_system_display != 0) {
5186 }
else { this->
ErrorMessage(
"Unrecognized parameter type of " + CP_name); }
5187 }
else { this->
ErrorMessage(
"Could not find such a parameter " + CP_name); }
5188 return perceived_value;
5208 int perceived_state = 0;
5210 if (_system_display != 0) {
5216 "Unreconginzed type othat than DisplayType::ComponentState or DisplayType::SupportSystemState for " + CP_name);
5218 }
else { this->
ErrorMessage(
"Could not find a system display for " + CP_name); }
5219 return perceived_state;
5228 int perceived_state = 0;
5230 if (_system_display != 0) {
5236 "Unreconginzed type other than DisplayType::SupportSystemState for " + CP_name);
5238 }
else { this->
ErrorMessage(
"Could not find a system display for " + CP_name); }
5239 return perceived_state;
5244 int perceived_state = 0;
5248 else { this->
ErrorMessage(
"Could not find a system alarm of " + CP_name); }
5250 return perceived_state;
5255 vector<string>::iterator str_itr;
5256 bool has_changed =
false;
5261 str_itr != this->m_current_thought_line_info->m_thought_line_list.end(); str_itr++) {
5266 str_itr != this->m_current_thought_line_info->m_thought_line_list.end(); str_itr++) {
5271 if (has_changed ==
true) {
5275 if (invest_pt == NULL) {
5278 if (invest_pt != NULL) {
5283 if (link_pt != NULL) {
5299 str_itr != this->m_working_on_invest_pt->m_thoughtline_roots_list.end(); str_itr++) {
5305 str_itr != this->m_working_on_invest_link_pt->m_thoughtline_roots_list.end(); str_itr++) {
5316 vector<Investigator *>::iterator invest_itr;
5317 vector<InvestigatorLink *>::iterator link_itr;
5318 vector<Statement *>::iterator state_itr;
5326 vector<IDElement *> subject_list;
5327 vector<IDElement *>::iterator subject_itr;
5332 for (
auto invest_itr = this->
m_investigator_pool.begin(); invest_itr != this->m_investigator_pool.end(); invest_itr++) {
5333 if ((*invest_itr)->m_Statement_pt != NULL) {
5334 (*invest_itr)->m_Statement_pt->m_investigator_ID_pt = NULL;
5335 (*invest_itr)->m_Statement_pt->m_ID_investigator =
"";
5344 if ((*link_itr)->m_invest_link_dormant ==
true || (*link_itr)->m_invest_link_pause ==
true
5345 || (*link_itr)->m_invest_link_Token ==
inv_link::TransferOut || (*link_itr)->m_forgotten_bl ==
true) {
continue; }
5348 if (
r5pars_.timesno - (*link_itr)->m_link_last_activated_time > this->m_decay_time) { remove_it =
true; }
5350 if ((*link_itr)->m_SI_ID_pt != NULL) { remove_it =
false; }
5352 if (remove_it ==
true) {
5353 (*link_itr)->m_forgotten_bl =
true;
5355 rm_aux_info =
"Item forgotten: ";
5356 rm_aux_info += (*link_itr)->m_ID;
5360 if (oldest_link_pt == NULL) { oldest_link_pt = link_itr->get(); }
5362 oldest_link_pt = link_itr->get();
5375 if ((*invest_itr)->m_invest_dormant ==
true
5376 && (
r5pars_.timesno - (*invest_itr)->m_investigation_initiate_time > this->m_decay_time / 2)) {
5380 if ((*invest_itr)->m_invest_dormant ==
false) {
5382 && (
r5pars_.timesno - (*invest_itr)->m_last_active_time > this->m_decay_time)) { remove_it =
true; }
5384 && (
r5pars_.timesno - (*invest_itr)->m_last_active_time > this->m_decay_time)) { remove_it =
true; }
5388 if ((*invest_itr)->m_note.compare(
"by event schema") == 0) { remove_it =
false; }
5390 if ((*invest_itr)->m_invest_pause ==
true) { remove_it =
false; }
5392 if (remove_it ==
true) {
5393 if ((*invest_itr)->m_ID ==
"Investigator_378") { this->
PrintMessage(
""); }
5395 rm_aux_info =
"Item forgotten: ";
5396 rm_aux_info += (*invest_itr)->m_ID;
5399 (*invest_itr)->m_investigation_closed =
true;
5404 if ((*invest_itr)->m_invest_dormant ==
false && (*invest_itr)->m_invest_pause ==
false) {
5406 if ((*invest_itr)->m_Statement_pt != NULL) {
5407 subject_pt = (*invest_itr)->m_Statement_pt->m_sent_pt->m_subject_pt;
5409 subject_pt = ((
KnowledgeElement *) ((*invest_itr)->m_KElement_ID_pt))->m_SentenceUnit_pt->m_subject_pt;
5411 for (subject_itr = subject_list.begin(); subject_itr != subject_list.end() && subject_pt != NULL;
5413 if (subject_pt == *subject_itr) { subject_pt = NULL; }
5415 if (subject_pt != NULL) {
5416 subject_list.push_back(subject_pt);
5419 if (oldest_invest_pt == NULL) {
5420 oldest_invest_pt = *invest_itr;
5421 }
else if ((*invest_itr)->m_last_active_time < oldest_invest_pt->
m_last_active_time) {
5422 oldest_invest_pt = *invest_itr;
5430 else { n_max_item = 7; }
5432 while (n_Count > n_max_item && (oldest_invest_pt != NULL || oldest_link_pt != NULL)) {
5434 if (oldest_invest_pt != NULL && oldest_link_pt != NULL) {
5440 rm_aux_info =
"Item forgotten: ";
5441 rm_aux_info += oldest_invest_pt->
m_ID;
5447 rm_aux_info =
"Item forgotten: ";
5448 rm_aux_info += oldest_link_pt->
m_ID;
5451 }
else if (oldest_invest_pt != NULL) {
5456 rm_aux_info =
"Item forgotten: ";
5457 rm_aux_info += oldest_invest_pt->
m_ID;
5463 rm_aux_info =
"Item forgotten: ";
5464 rm_aux_info += oldest_link_pt->
m_ID;
5470 subject_list.clear();
5471 if (oldest_link_pt != NULL) {
5473 oldest_link_pt = NULL;
5476 if ((*link_itr)->m_invest_link_pause ==
false && (*link_itr)->m_invest_link_dormant ==
false
5477 && (*link_itr)->m_forgotten_bl ==
false && (*link_itr)->m_invest_link_Token !=
inv_link::TransferOut) {
5479 if (oldest_link_pt == NULL) { oldest_link_pt = link_itr->get(); }
5481 oldest_link_pt = link_itr->get();
5487 if (oldest_invest_pt != NULL) {
5489 oldest_invest_pt = NULL;
5491 invest_itr != this->m_unresolved_investigator_pool.end(); invest_itr++) {
5492 if ((*invest_itr)->m_invest_dormant ==
false && (*invest_itr)->m_invest_pause ==
false
5493 && (*invest_itr)->m_investigation_closed ==
false) {
5494 if ((*invest_itr)->m_Statement_pt != NULL) {
5495 subject_pt = (*invest_itr)->m_Statement_pt->m_sent_pt->m_subject_pt;
5497 subject_pt = ((
KnowledgeElement *) ((*invest_itr)->m_KElement_ID_pt))->m_SentenceUnit_pt->m_subject_pt;
5499 for (subject_itr = subject_list.begin(); subject_itr != subject_list.end() && subject_pt != NULL;
5501 if (subject_pt == *subject_itr) { subject_pt = NULL; }
5503 if (subject_pt != NULL) {
5504 subject_list.push_back(subject_pt);
5507 if (oldest_invest_pt == NULL) { oldest_invest_pt = *invest_itr; }
5509 oldest_invest_pt = *invest_itr;
5531 if (_ID.compare(this->m_current_investigation_info->m_name) == 0) {
5539 info_ritr != this->m_investigation_history.rend() && count < 50 && found ==
false; info_ritr++) {
5540 if (_ID.compare((*info_ritr)->m_name) == 0) {
5559 vector<string>::iterator str_itr;
5567 this->
ErrorMessage(
"Unrecognized Investigation Item Input");
5573 str_itr != this->m_current_thought_line_info->m_thought_line_list.end(); str_itr++) {
5594 info_ritr != this->m_thought_line_history.rend() && found ==
false && count <= 20; info_ritr++) {
5595 for (str_itr = (*info_ritr)->m_thought_line_list.begin(); str_itr != (*info_ritr)->m_thought_line_list.end();
5623 vector<string>::iterator str_itr;
5624 vector<IDElement *>::iterator link_ID_itr;
5625 vector<IDElement *>::iterator invest_ID_itr;
5630 ofstream fout(_path.c_str(), ios::out);
5631 fout <<
"starting time" <<
'\t' <<
"ending time" <<
'\t' <<
"ID List" <<
'\n';
5632 for (
auto info_itr = this->
m_thought_line_history.begin(); info_itr != this->m_thought_line_history.end(); info_itr++) {
5633 fout << (*info_itr)->m_interval_start <<
'\t';
5634 fout << (*info_itr)->m_interval_end <<
'\t';
5635 for (str_itr = (*info_itr)->m_thought_line_list.begin(); str_itr != (*info_itr)->m_thought_line_list.end();
5637 fout << (*str_itr) <<
" || ";
5641 str_itr = (*info_itr)->m_thought_line_list.begin();
5643 if (invest_pt != NULL) {
5651 if (invest_pt->
m_explained == 3) { fout <<
"success"; }
5652 else if (invest_pt->
m_explained == 4) { fout <<
"fail"; }
5653 else if (invest_pt->
m_explained == 2) { fout <<
"uncertain"; }
5654 else if (invest_pt->
m_explained == 1) { fout <<
"unfinish"; }
5669 if ((*info_itr)->m_interrupted_bl ==
true) {
5670 fout <<
"Interrupted";
5671 }
else { fout <<
"Normal transit"; }
5678 ofstream fout(
"AuxInfo.txt", ios::app);
5679 fout <<
"Time: " <<
r5pars_.timesno <<
"\t" << str <<
'\n';
5686 bool within_line =
false;
5687 vector<string>::iterator str_itr;
5693 str_itr != this->m_current_thought_line_info->m_thought_line_list.end() && within_line ==
false; str_itr++) {
5709 activation = min<float>(_a, 1);
5710 if (activation < _sent_pt->m_activation) {
return; }
5722 bool stop_bl =
false;
5724 state_ritr != this->m_Statement_list.rend() && found_pt == NULL && stop_bl ==
false; state_ritr++) {
5725 state_pt = state_ritr->get();
5726 if (state_pt == _statement_pt) {
continue; }
5731 found_pt = state_pt;
5747 invest_ritr != this->m_investigator_pool.rend() && found ==
false; invest_ritr++) {
5748 invest_pt = invest_ritr->get();
5788 invest_pt = *invest_ritr;
5791 if (sent_pt1 != sent_pt2) {
continue; }
5795 if (time_center > invest_pt->
m_effective_start - 300 && time_center < invest_pt->m_effective_end + 300) {
5796 found_invest_pt = invest_pt;
5799 return found_invest_pt;
5820 invest_pt = *invest_ritr;
5830 if (sent_pt1 != sent_pt2) {
continue; }
5835 }
else if (time_center > invest_pt->
m_effective_start - 150 && time_center < invest_pt->m_effective_end + 150) {
5836 found_invest_pt = invest_pt;
5839 return found_invest_pt;
5843 vector<string>::iterator str_itr;
5852 if (_ID.compare(*str_itr) == 0) {
5860 vector<string>::iterator str_itr;
5864 if (_ID.compare(*str_itr) == 0) { added =
true; }
5879 exp(-0.04 * (
r5pars_.timesno - this->m_goofy_start_time))));
5892 vector<Statement *> state_list;
5893 vector<Statement *>::iterator state_itr;
5894 vector<Statement *>::iterator state_itr2;
5895 vector<Statement *>::iterator state_itr3;
5900 state_list.push_back(_state_pt);
5903 while (i < state_list.size()) {
5904 state_itr = state_list.begin();
5906 state_pt = *state_itr;
5914 if (invest_pt != NULL) {
5930 for (state_itr3 = state_list.begin(); exist_bl ==
false && state_itr3 != state_list.end(); state_itr3++) {
5931 if ((*state_itr3) == (*state_itr2)) { exist_bl =
true; }
5933 if (exist_bl ==
false) { state_list.push_back(*state_itr2); }
5939 for (state_itr3 = state_list.begin(); exist_bl ==
false && state_itr3 != state_list.end(); state_itr3++) {
5940 if ((*state_itr3) == (*state_itr2)) { exist_bl =
true; }
5942 if (exist_bl ==
false) { state_list.push_back(*state_itr2); }
5951 vector<IDElement *>::iterator ID_itr;
5965 vector<IDElement *>::iterator ID_itr;
5966 bool exist_bl =
false;
5968 for (ID_itr = this->
m_decayed_item_pt_list.begin(); ID_itr != this->m_decayed_item_pt_list.end() && exist_bl ==
false;
5970 if ((*ID_itr) == _ID_pt) {
5976 if (exist_bl ==
false) {
5982 vector<IDElement *>::iterator ID_itr;
5989 if (
r5pars_.timesno > 1740) { i = 0; }
5998 if (i == 23) { i = i; }
6000 if ((*ID_itr)->m_ID_Type == 301) {
6018 }
else if ((*ID_itr)->m_ID_Type == 302) {
6052 float max_confusion = 0;
6060 di_itr != this->m_event_schema_base->m_diagnose_invest_list.end(); di_itr++) {
6061 if ((*di_itr)->m_terminate_investigation ==
true) {
continue; }
6063 if ((*di_itr)->m_N_setback_list.size() > 0) {
6064 num = *((*di_itr)->m_N_setback_list.rbegin());
6066 { max_confusion = max((*di_itr)->m_confidence, max_confusion); }
6119 unique_ptr<ValueTimeLineUnit> vtu_pt;
6123 vtu_pt = make_unique<ValueTimeLineUnit>();
6124 vtu_pt->m_time =
r5pars_.timesno;
6129 vtu_pt = make_unique<ValueTimeLineUnit>();
6130 vtu_pt->m_time =
r5pars_.timesno;
6135 vtu_pt = make_unique<ValueTimeLineUnit>();
6136 vtu_pt->m_time =
r5pars_.timesno;
6141 vtu_pt = make_unique<ValueTimeLineUnit>();
6142 vtu_pt->m_time =
r5pars_.timesno;
6147 vtu_pt = make_unique<ValueTimeLineUnit>();
6148 vtu_pt->m_time =
r5pars_.timesno;
6153 vtu_pt = make_unique<ValueTimeLineUnit>();
6154 vtu_pt->m_time =
r5pars_.timesno;
6160 vtu_pt = make_unique<ValueTimeLineUnit>();
6161 vtu_pt->m_time =
r5pars_.timesno;
6167 vtu_pt = make_unique<ValueTimeLineUnit>();
6168 vtu_pt->m_time =
r5pars_.timesno;
6173 vtu_pt = make_unique<ValueTimeLineUnit>();
6174 vtu_pt->m_time =
r5pars_.timesno;
6179 vtu_pt = make_unique<ValueTimeLineUnit>();
6180 vtu_pt->m_time =
r5pars_.timesno;
6185 vtu_pt = make_unique<ValueTimeLineUnit>();
6186 vtu_pt->m_time =
r5pars_.timesno;
6191 vtu_pt = make_unique<ValueTimeLineUnit>();
6192 vtu_pt->m_time =
r5pars_.timesno;
6197 vtu_pt = make_unique<ValueTimeLineUnit>();
6198 vtu_pt->m_time =
r5pars_.timesno;
6207 for (
auto KU_itr = this->
m_Knowledge_list.begin(); KU_itr != this->m_Knowledge_list.end(); KU_itr++) {
6208 fl = ((float) rand() / float(RAND_MAX));
6209 if (fl > (*KU_itr)->m_knowledge_strength) {
6211 str =
"Disabled Knowledge Link: " + (*KU_itr)->m_ID;
6227 file_name +=
"RMOutPut/";
6228 file_name +=
"ODM_Knowledge_Web.txt";
6229 ofstream fout(file_name.c_str(), ios::out);
6237 fout <<
"upstream phenomenon" <<
'\t'
6238 <<
"downstream phenomenon" <<
'\t'
6239 <<
"causal type" <<
'\t'
6240 <<
"inference type" <<
'\t'
6241 <<
"familiarity" <<
'\t'
6242 <<
"strength 1" <<
'\t'
6243 <<
"strength 2" <<
'\t'
6244 <<
"delta T1" <<
'\t'
6245 <<
"delta T2" <<
'\t'
6246 <<
"conditional phenomenon" <<
'\n';
6248 for (
auto KU_itr = this->
m_Knowledge_list.begin(); KU_itr != this->m_Knowledge_list.end(); KU_itr++) {
6249 KU_pt = KU_itr->get();
Diagnostic reasoning engine — knowledge representation, mental model, and inference.
SimulationContext g_sim
Global simulation context: the single instance, defined in SimulationContext.cpp.
void UpdateTheBaseLineValueAfterAChange(float _decay_lamda)
std::string getAlarmName()
int getDisplayedAlarmState()
int getIDOfRecentGeneratedES()
std::vector< IDElement * > m_antonym_list
IDElement * m_Indefinite_Concept_ID_pt
IDElement * m_label_ID_pt
SystemAlarm * getAlarmFromMap(std::string)
SystemDisplay * getDisplayFromMap(std::string)
ControlPanelDisplay indicators
int getDisplayedComponentOperationalState()
std::string getDisplayName()
double getDisplayedParameterValue()
int getDisplayedSupportSystemOperationalState() const
std::vector< std::shared_ptr< MentalSupportSystemState > > perceived_support_system_state
std::vector< std::shared_ptr< MentalParameterValue > > perceived_parameter_value
int ReturnPositionOfOneMentalParameterValue(MentalParameterValue *)
int ReturnPositionOfOneMentalAlarmInTheVector(MentalAlarm *)
std::vector< std::shared_ptr< MentalAlarm > > perceived_alarms
std::vector< std::shared_ptr< MentalComponentState > > perceived_component_state
int ReturnPositionOfOneMentalComponentStateInTheVector(MentalComponentState *)
int ReturnPositionOfOneMentalSupportSystemStateInTheVector(MentalSupportSystemState *)
std::vector< ConceptComposedUnit * > m_instance_list
float GetActivationOfthisLink()
void OneStepWorkOnThisInvestigatorLink()
float m_link_last_activated_time
std::vector< std::string > m_thoughtline_roots_list
IDElement * m_condition_ID_pt
KnowledgeUnit * m_K_unit_pt
bool CheckWhetherInAThoughtLine(std::string)
bool m_invest_link_dormant
std::string GetASimpleDescriptionOfTheInvestigatorLink()
std::vector< int > m_invest_link_Token_history
IDElement * m_downstream_ID_pt
float GetDownstreamInitiationTimeOrStatementTime()
std::vector< IDElement * > m_upperstream_ID_list
bool m_investigation_closed
double m_investigation_initiate_time
std::string GetASimpleDescriptionOfThisInvestigator()
SentenceUnit * GetSemanticSentenceOfThisInvestigator()
void ReopenThisInvestigator()
std::vector< IDElement * > m_explanation_link_list
Statement * m_possible_statement_pt
IDElement * m_KElement_ID_pt
bool m_Explain_incomplete
bool m_active_investigation
bool m_root_of_a_thought_line
Statement * m_inconsistant_statement
std::vector< IDElement * > m_downstream_ID_list
bool CheckWhetherInAThoughtLine(std::string)
double m_investigation_cease_time
std::vector< IDElement * > m_upperstream_ID_list
void OneStepWorkOnThisInvestigator()
float CalculateFilteredPrioritizingScoreOfInvestigator()
std::vector< int > m_investigator_token_history
std::vector< float > m_invest_token_endtime_history
std::vector< std::string > m_thoughtline_roots_list
float GetInitiationTimeOrStatementTimeOrLastActiveTime()
Statement * m_Statement_pt
SentenceUnit * m_SentenceUnit_pt
std::vector< KnowledgeElement * > M_KElement_list
void ReadThisKNinfoFromFile(std::ifstream &)
IDElement * m_Descendant_pt
IDElement * m_Permission_pt
IDElement * m_Ancestor_pt
float m_knowledge_strength
double m_forward_retrieve_weight
void ReadKnowledgeUnitFromInputFile(std::ifstream &)
double m_backward_retrieve_weight
std::vector< IDElement * > m_label_option_list
void AddNewAlarmState(int, int, bool)
std::string m_alarm_indicator_name
void AddNewAlarmStateForFirstRoundCheck(int, int)
void AddNewState(int, int, bool)
void AddNewStateForFirstRoundCheck(int, int)
IDElement * m_Concept_ID_pt
std::string Control_Value_Indicator_ID
std::string Component_State_Indicator_ID
void AddNewPositionValue(float, int, bool)
MRValueSchema * FoundAPositionReadingWithinTimeRange(float, float)
void AddNewRateForFirstRoundCheck(float, int)
std::string m_parameter_indicator_ID
void AddNewRate(float, int, bool)
void AddNewValue(float, int, bool)
IDElement * m_Concept_ID_pt
void AddNewValueForFirstRoundCheck(float, int)
MRValueSchema * FoundAValueReadingWithinTimeRange(float, float)
std::string m_parameter_rate_indicator_ID
IDElement * m_Concept_ID_pt
std::string Support_System_State_Indicator_ID
void AddNewStateForFirstRoundCheck(int, int)
void AddNewState(int, int, bool)
int getObservedAlarmState()
int getObservedComponentState()
double getObservedParameterValue()
int getObservedSupportSystemState()
TimeConstrainedModule time_constrained_load
std::vector< std::string > indication_concept_ID_list
std::vector< int > m_position_tbi_SS_list
std::vector< std::unique_ptr< ValueTimeLineUnit > > m_time_load_history
void CopySemanticInfoFromAnotherSemanticBase(ReasonMachine *)
void ReadKnowledgeBaseFromInputFile()
std::vector< std::unique_ptr< StringTimeIntervalUnit > > m_investigation_history
float m_initial_fatigue_level
int m_max_length_of_alarms_stack
float m_system_dynamic_level
std::unique_ptr< KBConcept > m_Concept_Base
Investigator * FindASimilarInvestigatorRecentlyResolved(Investigator *)
Investigator * FindAMatchInvestigatorByKnowledgeElement(KnowledgeElement *, int, int)
InvestigatorLink * FindInvestigatorLinkByID(std::string)
void RemoveItemFromDecayedItemList(IDElement *)
void AddItemToDecayedItemList(IDElement *)
void SavePSFandDynamicParametersToFile(std::string _path)
std::vector< std::unique_ptr< ValueTimeLineUnit > > m_fatigue_history
std::string m_ID_buffer_invest_pt
float m_memory_span_base_value
void UpdateManifestationParameterAtEndOfATimeStep()
void ConvertRMStaticInfoToStringForm()
void ReOpenItemWithActivationLevelAboveAGivenValue(float)
KnowledgeUnit * FindKnowledgeUnitByID(std::string)
std::vector< Statement * > m_new_Statement_list
std::vector< std::string > m_ID_discarded_invest_pool
std::vector< std::unique_ptr< Investigator > > m_investigator_pool
void AddANewKnowledgeUnit(KnowledgeUnit *)
void ErrorMessage(std::string)
void SaveInvestigationsToFile(std::string _path)
SentenceUnit * SearchSentenceByID(std::string)
double m_alarm_disruption_time_consumption
std::vector< std::unique_ptr< ValueTimeLineUnit > > m_cognitive_resouse_use_history
void EraseFromOngoingItemStack(std::string)
void AddNewInvestigatorLink(InvestigatorLink *)
std::vector< std::unique_ptr< ValueTimeLineUnit > > m_max_alarm_length_timeline
std::vector< std::unique_ptr< InvestigatorLink > > m_investigator_link_pool
std::string m_ID_working_on_invest
std::vector< Statement * > m_temporary_statement_list
void RandomlyGenerateKnowledgeBug()
std::vector< Investigator * > m_undetermined_investigator_pool
void AutoIgnitionOfDecayedInvestigatorInitiatedByActivatingAStatement(Statement *)
void ActivationUpdateByRefreshAStatement(Statement *)
float m_cognitive_time_cost_base_multiplier
std::vector< std::unique_ptr< ValueTimeLineUnit > > m_cognitive_load_history
void AddPSFandManifestationDataSet()
void AddOneInvestigatorByStatement(Statement *)
float m_decay_time_base_value
float m_routine_monitor_threshold
double m_decay_constant_lamda
int GetAComponentStateImediately(std::string MR_name)
std::vector< MentalAlarm * > m_tbi_A_list
Investigator * m_working_on_invest_pt
Statement * FindRecentStatementBySentence(SentenceUnit *)
std::vector< std::unique_ptr< ValueTimeLineUnit > > m_attention_span_history
bool m_first_round_check_done
void OneStepWorkOnSelectedInvestigatorLink3100()
void OneStepOfReasonMachine()
std::vector< MentalComponentState * > m_tbi_C_list
void WaitOneStepThereIsOneOrMoreOperatorBranches()
std::vector< Investigator * > m_failed_investigator_pool
void AddToRMFeedbackStack(IDElement *)
std::vector< std::string > m_ongoing_item_stack
void AddDeltaToCognitiveLoad(float)
std::vector< std::string > m_ID_unresolved_invest_pool
float GetAParameterValueImediately(std::string)
void DecayOfForgottenInvestigator()
void AddANewStatement(Statement *)
std::vector< Investigator * > m_discarded_investigator_pool
void ActivationDecayofRM()
void ZeroAllTheInterestFromSymptomInvestigator()
std::vector< std::unique_ptr< SentenceUnit > > m_Semantic_list
void CopyStaticKNfromAnotherRM(ReasonMachine *)
void RemoveInvestigatorFromUnresolvedPool(Investigator *)
float m_load_stress_integration_of_time
KnowledgeElement * FindKnowledgeElementByID(std::string)
SentenceUnit * FindAnIndefiniteSentenceMatchTheInputSentence(SentenceUnit *)
void AddItemToOngoingItemStack(std::string)
void CopyReasonMachineFromAnotherRM(ReasonMachine *)
TimeConstrainedModule * m_time_constraint
std::vector< std::string > m_ID_cause_undertermined_invest_pool
std::vector< std::unique_ptr< StringTimeIntervalUnit > > m_thought_line_history
std::vector< Investigator * > m_unresolved_investigator_pool
void ClearTBIListsForRestart()
KnowledgeElement * FindAKEbySentenceAndNegationSign(SentenceUnit *, bool)
std::vector< std::string > m_ID_feedback_stack
void SetAllSentenceActivationRatioToOne()
void CopyStaticKEfromAnotherRM(ReasonMachine *)
void ClearThisReasonMachine()
void ReadOperatorReasonMachineProfile()
void SaveThoughtLineHistory(std::string)
void EraseItemFromFeedbackStack(IDElement *)
float m_cognitive_resource_use
int FindThePositionInTheInvestigationHistory(std::string)
void PropagateActivationFromConceptToSemanticSentence()
InvestigatorLink * m_working_on_invest_link_pt
int GetAlarmStateImediately(std::string CP_name)
float m_diagnosis_complexity
std::vector< std::unique_ptr< Statement > > m_Statement_list
std::vector< int > m_position_tbi_A_list
void ReadSemanticSentencesFromInputFile()
std::vector< std::unique_ptr< ValueTimeLineUnit > > m_cognitive_time_cost_multiplier_history
std::unique_ptr< RoutineMonitor > m_routine_monitor
std::vector< std::unique_ptr< ValueTimeLineUnit > > m_diagnosis_complexity_history
IDElement * FindInvestigatorOrLinkByID(std::string)
void ReadKEBaseAndKNFromInputFile()
std::vector< MentalParameterValue * > m_tbi_P_list
float m_ability_of_integrating_evidence
std::vector< IDElement * > m_feedback_stack
std::vector< Investigator * > m_cause_undetermined_investigato_pool
std::unique_ptr< ProximityModel > m_proximity
KnowledgeElement * FindKnowledgeElementByStatement(Statement *)
std::vector< std::string > m_ID_undertermined_invest_pool
IDElement * m_reading_indication_ID_pt
void SaveRMHisoty(std::string)
std::vector< std::unique_ptr< KnowledgeNode > > m_KN_list
std::vector< std::unique_ptr< ValueTimeLineUnit > > m_routine_monitor_interval_multiplier_history
void CutTheLengthOfAlarmStack()
void CheckWhetherTheThoughtLineHasChanged()
ProblemSolvingStyle m_problem_solving_style
void AddConsumptedDeltaT(double)
Statement * FoundASimilarStatementInLast10Seconds(Statement *)
void WriteAuxInfo(std::string str)
int m_investigator_number
std::vector< std::unique_ptr< KnowledgeElement > > m_KE_list
std::string m_ID_reading_indication
std::unique_ptr< InstantiationBase > m_IB
std::vector< float > m_RM_token_endtime_history
Statement * FindStatementByID(std::string)
std::unique_ptr< MentalRepresentation > m_MR
std::vector< std::string > m_ID_temporary_statement_list
float m_routine_monitor_interval_multiplier
void OneRoundActivationSpreadingFromASentence(SentenceUnit *)
std::vector< std::unique_ptr< ValueTimeLineUnit > > m_stress_history
void PrintMessage(std::string)
Investigator * FindInvestigatorByID(std::string)
std::vector< std::string > m_ID_resolved_invest_pool
std::vector< IDElement * > m_investigation_trace
int GetASupportSystemStateImediately(std::string MR_name)
void OneStepInterpretation20()
SentenceUnit * CheckExistInSemanticPoolBySentence(SentenceUnit *)
void SettingForVagabondStyle()
Investigator * FindASimilarOngoingInvestigator(Investigator *)
std::vector< std::string > m_decayed_item_ID_list
std::vector< std::unique_ptr< KnowledgeUnit > > m_Knowledge_list
void InitiationOfReasonMachineFromInputFile()
float CheckRemainingTimeForThisStep()
std::vector< std::string > m_ID_invest_trace
void SaveStatementsToFile(std::string _path)
std::unique_ptr< StringTimeIntervalUnit > m_current_thought_line_info
std::vector< std::string > m_ID_new_statement_list
std::vector< std::unique_ptr< ValueTimeLineUnit > > m_cognitive_time_cost_multiplier_timeline
std::vector< std::unique_ptr< ValueTimeLineUnit > > m_memory_span_history
int FindThePositionInTheThoughtLineHistory(IDElement *)
void FindCorrespondingStatementWithinTimeRange(SentenceUnit *, int, int)
std::unique_ptr< EventSchemaBase > m_event_schema_base
std::unique_ptr< PassiveAlarmLoadUnit > m_passive_alarm_load
std::vector< std::string > m_ID_succes_invest_pool
void UpdatePSFAtEndOfATimeStep()
void AddDeltaToSystemDynamics(float)
KnowledgeNode * FindKNByID(std::string)
std::vector< Investigator * > m_resolved_investigator_pool
std::string TranslateRMTokenToWords(int)
std::vector< std::string > m_ID_failed_invest_pool
void AddBackToUnresolvedInvestigationPool(Investigator *)
void ChangeRMTokenValue(int)
void MakeOneStepInferenceFromAStatement(Statement *)
int m_investigator_link_number
std::vector< IDElement * > m_decayed_item_pt_list
void SaveInvestigationLinkInfo(std::string)
void BalanceTimerWithUnconsumedTime()
void BuildTheConnectionsWithinRM()
bool FindAMatchingInvestigatorForAStatement(Statement *)
void CrankASentenceUnitActivationToAGivenValue(SentenceUnit *, float)
float m_cognitive_time_cost_multiplier
void SaveSequenceInfoToFile()
std::unique_ptr< StringTimeIntervalUnit > m_current_investigation_info
std::string m_ID_working_on_invest_link
Investigator * m_buffer_invest_pt
std::vector< int > m_RM_Token_history
Statement * CheckWhetherASentenceIsTrueFromMR(SentenceUnit *, int, int)
void OneStepPrioritizeInvestigation30()
float m_attention_span_base_value
double m_Interpretation_time_consumption
void AddNewInvestigator(Investigator *)
std::vector< int > m_position_tbi_C_list
void OneStepWorkOnSelectedInvestigator3000()
void AddANewDiagnoseInvestigator(DiagnoseInvestigator *_diagnose_invest_pt)
void OneStepRoutineMonitor10()
std::vector< std::unique_ptr< ValueTimeLineUnit > > m_decay_time_history
bool WetherAnInvestigationItemBelongsToTheCurrentThoughtLine(IDElement *)
std::vector< int > m_position_tbi_P_list
std::vector< Investigator * > m_success_investigator_pool
std::vector< MentalSupportSystemState * > m_tbi_SS_list
SentenceUnit * InstantiateAnIndefiniteSentenceWithLabel(SentenceUnit *, IDElement *)
void FirstRoundCheckInterpretation()
std::string getOATDirectory()
std::string getOutputDirectory()
std::string getODMDirectory()
IDElement * m_comparison_pt
void ActivationPropagationFromConceptBottomUp(int)
IDElement * GetLabelOfThisSentence()
void CopyFromAnotherSentence(SentenceUnit *)
IDElement * m_attribute_pt
void PropagateActivationToConceptUnitsTopDown(int)
std::vector< Statement * > m_downstream_statement_list
std::vector< Statement * > m_upperstream_statement_list
void PrintThisStatement()
double m_last_activated_time
std::string GetThisStatementWords()
void CopyAuxInfoFromUpperstreamStatement(Statement *)
IDElement * m_investigator_ID_pt
DisplayType getTypeOfDisplay()
double getTimeConstrainedPIFValue()
float GetTimeBoundEarlier()
void CopyTimeRangeFromAnother(TimeRange &)
float GetTimeBoundLater()
constexpr int RetrieveNextInvestigator
constexpr int ActiveThreshold
constexpr int CheckPathStatus
constexpr int TransferOut
constexpr int FindMatchingStatement
constexpr int RetrieveNextLink
constexpr int GetCorrespondingKE
constexpr int RequestInfoRead
constexpr int ActiveThreshold
constexpr int EvaluateNewFeedback
constexpr int RoutineMonitor
constexpr int WorkOnInvestigator
constexpr int WorkOnInvestigatorLink
Scheduler SScheduler
Simulation scheduling, parses CLI options.
OperatorAT Action_Taker
Crew action execution model.
ControlPanel Indicator
Control room panel state.
OperatorDM Decision_Maker
Crew decision-making model.
BranchRecord Branch_center
Dynamic event tree state.