6#include "../ControlPanel/ControlPanel.h"
7#include "../Global/fmodule.h"
8#include "../Scheduler/Scheduler.h"
9#include "../ControlPanel/SystemDisplay.h"
10#include "../ControlPanel/DisplayParameterValue.h"
11#include <boost/serialization/export.hpp>
12#include "../Global/SimulationContext.h"
13#include <boost/archive/binary_oarchive.hpp>
14#include <boost/archive/binary_iarchive.hpp>
75 double _current_time =
r5pars_.timesno;
76 int num_history_data_points = 10;
81 for (
int i=0; i < num_history_data_points; i++)
91 cout <<
"TimeConstrainedUnit::CalculateTimeToThreshold could not find TimeConstrainedUnit corresponding parameter " << this->
getCorrespondingIndicatorName() << endl;
92 ofstream fout(
"err messages.txt", ios::app);
93 fout <<
r5pars_.timesno <<
" TimeConstrainedUnit::CalculateTimeToThreshold could not find TimeConstrainedUnit corresponding parameter " << this->
getCorrespondingIndicatorName() <<
'\n';
123 double x1, x2, x21, x22, x3, x4;
133 upper_limit = 1.0E+06;
135 deque<double>::iterator time_constrained_parameter_history_itr;
136 deque<double>::iterator time_history_itr;
144 x1 += (*time_constrained_parameter_history_itr) * (*time_history_itr);
145 x21 += (*time_constrained_parameter_history_itr);
146 x22 += (*time_history_itr);
147 x3 += (*time_history_itr) * (*time_history_itr);
324 double new_unit_pif_value = 0.0;
329 new_unit_pif_value = 10.0;
333 new_unit_pif_value = 0.0;
347 new_unit_pif_value = 10.0;
351 new_unit_pif_value = 0.0;
412 int i_threshold_exceeded = 0;
415 deque <double>::iterator d_itr;
418 if (Parameter_Value < 1.0E-30 && Parameter_Value > -1.0E-30) {
421 if (Parameter_Rate < 1.0E-30 && Parameter_Rate > -1.0E-30) {
424 if (Initial_Value < 1.0E-30 && Initial_Value > -1.0E-30) {
439 << i_threshold_exceeded <<
' '
447 if (xtemp < 1.0E-30 && xtemp > -1.0E-30) {
450 fout << xtemp <<
' ';
456 if (xtemp < 1.0E-30 && xtemp > -1.0E-30) {
459 fout << xtemp <<
' ';
464 int i, num_obj, i_threshold_exceeded;
477 >> i_threshold_exceeded
482 if (i_threshold_exceeded == 0) {
488 for(i = 0; i < num_obj; i++){
493 for(i = 0; i < num_obj; i++){
SimulationContext g_sim
Global simulation context: the single instance, defined in SimulationContext.cpp.
SystemDisplay * getDisplayFromMap(std::string)
ControlPanelDisplay indicators
double getDisplayedParameterValue()
double getTimeAtWhichThisInfoIsPerceived()
double getInitialParameterValue()
double Normal_Parameter_Threshold
std::deque< double > time_constrained_time_history
double getTimeToNormalThreshold()
double getNormalParameterThreshold()
double Time_To_Accident_Threshold
void setLowerTimeThreshold(double)
void retrieveTimeConstrainedUnitFromFile(std::ifstream &)
void setTimeThresholdExceeded(double)
void clearTimeConstrainedUnit()
double Time_Constrained_Unit_PIF_Value
std::deque< double > time_constrained_parameter_history
double getTimeThresholdExceeded()
void copyTimeConstrainedUnit(TimeConstrainedUnit &)
double getParameterRate()
void setBuildupTau(double)
void setAccidentParameterThreshold(double)
void CalculateTimeToThreshold()
double time_threshold_exceeded
void CalculateTimeConstrainedUnitPIFValue(int, bool, double)
double getAccidentParameterThreshold()
SystemDisplay * getPtrToCorrespondingIndicator()
double getTimeToAccidentThreshold()
void setNormalParameterThreshold(double)
void setCorrespondingIndicatorName(std::string)
double lower_time_threshold
bool getThresholdExceeded()
double upper_time_threshold
SystemDisplay * ptr_to_corresponding_indicator
void setTimeConstrainedUnitName(std::string)
double Time_To_Normal_Threshold
void setThresholdExceeded(bool)
void setParameterRate(double)
double Accident_Parameter_Threshold
std::string Corresponding_Indicator_Name
void saveTimeConstrainedUnitToFile(std::ofstream &)
double getUpperTimeThreshold()
virtual ~TimeConstrainedUnit()
void setPtrToCorrespondingIndicator(SystemDisplay *)
void setUpperTimeThreshold(double)
std::string getCorrespondingIndicatorName()
std::string getTimeConstrainedUnitName()
void updateRawData(double, InfoChunk *)
double getTimeConstrainedUnitPIFValue()
std::string Time_Constrained_Unit_Name
void readInfoFromFile(std::ifstream &)
double getParameterValue()
double getLowerTimeThreshold()
constexpr int MonitorAbnormal
constexpr int MaintainGlobalSafetyMargin
constexpr int TroubleShoot
ControlPanel Indicator
Control room panel state.