2#include "../Crew/OperatorDM.h"
4#include "../Global/SimulationContext.h"
36 if (invest_pt != NULL) {
50 if (invest_pt != NULL) {
119 auto state_pt = make_unique<MRStateSchema>();
120 state_pt->CopyStateSchemaFromAnother(
e.get());
131 bool NewStatement_bl =
false;
151 prompt =
"Received new reading of ";
161 NewStatement_bl =
true;
180 if(found_sent_pt != 0)
182 auto stmt = make_unique<Statement>();
183 stmt->m_factual_type = 1;
184 stmt->m_confidence =1;
185 stmt->m_sent_pt = found_sent_pt;
186 stmt->m_state =
true;
187 stmt->m_time_range.m_time_after = this->
m_recent_state->m_time_perceived;
188 stmt->m_time_range.m_time_before =
r5pars_.timesno;
189 statement_pt = stmt.get();
196 NewStatement_bl =
true;
200 NewStatement_bl =
false;
210 if(NewStatement_bl ==
true)
230 if(found_sent_pt != 0)
232 auto stmt = make_unique<Statement>();
233 stmt->m_factual_type = 1;
234 stmt->m_confidence =1;
235 stmt->m_sent_pt = found_sent_pt;
236 stmt->m_state =
true;
237 stmt->m_time_generated =
r5pars_.timesno;
238 stmt->m_time_range.m_start_time =
r5pars_.timesno;
240 {stmt->m_time_range.m_time_after = this->
m_recent_state->m_time_perceived;}
241 stmt->m_time_range.m_end_time =
r5pars_.timesno;
242 statement_pt = stmt.get();
291 bool NewStatement_bl =
false;
304 }
else if (_state == 3023 || _state == 3099)
310 prompt =
"Received new reading of ";
321 NewStatement_bl =
true;
340 if(found_sent_pt != 0)
342 auto stmt = make_unique<Statement>();
343 stmt->m_factual_type = 1;
344 stmt->m_confidence =1;
345 stmt->m_sent_pt = found_sent_pt;
346 stmt->m_state =
true;
347 stmt->m_time_range.m_time_after = this->
m_recent_state->m_time_perceived;
348 stmt->m_time_range.m_time_before =
r5pars_.timesno;
349 statement_pt = stmt.get();
354 if(_expecting ==
true)
368 auto inv = make_unique<Investigator>();
369 inv->m_note =
"by a statement";
370 inv->m_motivation = 1;
371 inv->m_Statement_pt = statement_pt;
375 inv->m_root_of_a_thought_line =
true;
376 invest_pt =
inv.get();
385 NewStatement_bl =
true;
389 NewStatement_bl =
false;
399 if(NewStatement_bl ==
true)
419 if(found_sent_pt != 0)
421 auto stmt = make_unique<Statement>();
422 stmt->m_factual_type = 1;
423 stmt->m_confidence =1;
424 stmt->m_sent_pt = found_sent_pt;
425 stmt->m_state =
true;
426 stmt->m_time_generated =
r5pars_.timesno;
427 stmt->m_time_range.m_start_time =
r5pars_.timesno;
429 {stmt->m_time_range.m_time_after = this->
m_recent_state->m_time_perceived;}
430 stmt->m_time_range.m_end_time =
r5pars_.timesno;
431 statement_pt = stmt.get();
436 if(_expecting ==
true)
467 if(
e->m_time_perceived > _end)
469 found_state_schema_pt =
e.get();
470 return found_state_schema_pt;
478 return found_state_schema_pt;
489 return found_state_schema_pt;
493 for(
auto ritr = this->
m_history_state.rbegin(); ritr != this->m_history_state.rend(); ++ritr)
495 if((*ritr)->m_time_perceived < _start)
497 found_state_schema_pt = ritr->get();
498 return found_state_schema_pt;
502 return found_state_schema_pt;
506 if(this->
m_recent_state->m_time_perceived >= _start && this->m_recent_state->m_time_perceived <= _end)
509 return found_state_schema_pt;
515 if(
e->m_time_perceived >= _start &&
e->m_time_perceived <= _end)
517 found_state_schema_pt =
e.get();
521 return found_state_schema_pt;
526 cout <<
"Time: " <<
r5pars_.timesno <<
": " << str <<
'\n';
529 ofstream fout(
"RMI.txt", ios::app);
530 fout <<
"Time: " <<
r5pars_.timesno <<
": " << str <<
'\n';
536 cout <<
r5pars_.timesno <<
" " << str <<
" in MRSupportSystemStateUnit.cpp" <<
'\n';
537 ofstream fout(
"err messages.txt", ios::app);
538 fout <<
r5pars_.timesno <<
" " << str <<
'\n';
SimulationContext g_sim
Global simulation context: the single instance, defined in SimulationContext.cpp.
void CopyIDElementToRestartInfo(IDElement *)
bool m_investigation_closed
SentenceUnit * GetSemanticSentenceOfThisInvestigator()
void ReopenThisInvestigator()
Statement * m_Statement_pt
void PrintMessage(std::string)
void ReadSupportSystemStateIndication(double)
Statement * m_recent_action_statement
IDElement * m_Concept_ID_pt
MRStateSchema * CheckLastSupportSystemStateReadingBeforeATime(float _start)
std::string m_ID_recent_state_statement
Statement * m_recent_state_statement
void UpdateTheRelevantInvestigator(int)
std::string Support_System_State_Indicator_ID
MRStateSchema * CheckTheFirstSupportSystemStateReadingAfterATime(float _end)
std::unique_ptr< MRStateSchema > m_recent_state
void AddNewStateForFirstRoundCheck(int, int)
std::vector< std::unique_ptr< MRStateSchema > > m_history_state
void ErrorMessage(std::string str)
std::string m_ID_recent_action_statement
void CopyMRSupportSystemStateUnitInfoFromAnother(MRSupportSystemStateUnit *)
virtual ~MRSupportSystemStateUnit()
void BuildConnectionsForThisMRSupportSystemStateUnit(void *)
MRStateSchema * CheckSupportSystemStateWithinTimeRange(float _start, float _end)
MRSupportSystemStateUnit()
void AddNewState(int, int, bool)
std::unique_ptr< ReasonMachine > m_RM
void ActiveFetchSupportSystemStateInfo(std::string, int)
std::unique_ptr< KBConcept > m_Concept_Base
void ActivationUpdateByRefreshAStatement(Statement *)
Investigator * m_working_on_invest_pt
void AddDeltaToCognitiveLoad(float)
void AddANewStatement(Statement *)
Statement * FindStatementByID(std::string)
Investigator * FindInvestigatorByID(std::string)
SentenceUnit * CheckExistInSemanticPoolBySentence(SentenceUnit *)
void AddDeltaToSystemDynamics(float)
void AddNewInvestigator(Investigator *)
void RefreshStatementEndTimeToCurrentTime(int)
IDElement * m_investigator_ID_pt
std::string m_ID_investigator
OperatorAT Action_Taker
Crew action execution model.
OperatorDM Decision_Maker
Crew decision-making model.