6#include "../Procedure/ExpectedMentalBelief.h"
7#include <boost/serialization/export.hpp>
8#include "../Global/SimulationContext.h"
9#include <boost/archive/binary_oarchive.hpp>
10#include <boost/archive/binary_iarchive.hpp>
41 bool reactor_tripped =
false;
49 reactor_tripped =
true;
55 item->CalculateTimeToThreshold();
62 double TCL_unit_value;
63 double new_TCL_value = 0.0;
70 TCL_unit_value = item->getTimeConstrainedUnitPIFValue();
71 new_TCL_value = fmax(new_TCL_value,TCL_unit_value);
79 string limiting_parameter =
"NONE";
82 if(item->getTimeConstrainedUnitPIFValue() > max_PIF) {
83 max_PIF = item->getTimeConstrainedUnitPIFValue();
84 limiting_parameter = item->getCorrespondingIndicatorName();
87 if (limiting_parameter ==
"NONE") {
90 return limiting_parameter;
101 auto time_constrained_unit_pt = make_unique<TimeConstrainedUnit>();
102 time_constrained_unit_pt->copyTimeConstrainedUnit(*src);
117 fout <<
'\t'<<str<<
"Time_Constrained_PIF_Value";
130 fout <<
"\t Range:_0-10";
132 fout <<
"\t --" <<
"\t --" <<
"\tMinutes to Threshold" <<
"\tMinutes to Threshold";
139 int num_time_constrained_parameters, num_history_data_points;
140 double lower_threshold, upper_threshold, decay_tau, buildup_tau;
142 num_history_data_points = 10;
144 ifstream fin(_file_name.c_str(), ios::in);
146 cout <<
"File: " << _file_name <<
" cound not be found" << endl;
147 ofstream fout(
"err messages.txt", ios::app);
148 fout <<
r5pars_.timesno <<
" File: " << _file_name <<
" cound not be found\n";
152 fin >> str >> num_time_constrained_parameters
154 fin >> str >> lower_threshold;
155 fin >> str >> upper_threshold;
156 fin >> str >> decay_tau;
157 fin >> str >> buildup_tau;
158 for (i = 0; i < num_time_constrained_parameters; i++){
159 auto time_constrained_array_ptr = make_unique<TimeConstrainedUnit>();
163 time_constrained_array_ptr->
setDecayTau(decay_tau);
184 item->saveTimeConstrainedUnitToFile(fout);
193 for(i = 0; i < num_obj;i++){
194 auto TimeConstrainedUnit_pt = make_unique<TimeConstrainedUnit>();
195 TimeConstrainedUnit_pt->retrieveTimeConstrainedUnitFromFile(fin);
ExpectedMentalBelief * checkExistanceOfMentalBelief(std::string)
int getStateOfActivation()
void outputTimeConstrainedLabelToFile(std::string, std::ofstream &)
void retrieveTimeConstrainedModuleFromFile(std::ifstream &)
double Time_Lapse_for_Update
void setTimeConstrainedPIFValue(double)
virtual ~TimeConstrainedModule()
void copyTimeConstrainedData(TimeConstrainedModule &)
double getTimeConstrainedPIFValue()
void initiationForSimulation(std::string)
double getLastUpdateTime()
void clearTimeConstrainedData()
void operatorUpdateTimeConstrainedValuesWithGoal(InfoChunk *)
void outputTimeConstrainedUnitsToFile(std::ofstream &)
void setLastUpdateTime(double)
std::vector< std::unique_ptr< TimeConstrainedUnit > > Time_Constrained_Parameter_Array
double getTimeLapseForUpdate()
void saveTimeConstrainedModuleToFile(std::ofstream &)
void updateRawDataAndCalculateTimeToThreshold(InfoChunk *)
double Time_Constrained_PIF_Value
std::string determineLimitingTimeConstrainedParameter()
void setTimeLapseForUpdate(double)
void setLowerTimeThreshold(double)
void setBuildupTau(double)
void setUpperTimeThreshold(double)
void readInfoFromFile(std::ifstream &)