2#include "../Branch/BranchRecord.h"
3#include "../ControlPanel/ControlPanel.h"
4#include "../ControlPanel/DisplaySupportSystemState.h"
5#include "../Global/TermConversions.h"
6#include <boost/serialization/export.hpp>
7#include "../Global/SimulationContext.h"
9#include <boost/archive/binary_oarchive.hpp>
10#include <boost/archive/binary_iarchive.hpp>
35 for (
int j = 0; j < support_systems_state_array.size(); ++j) {
36 std::string topNode = support_systems_state_array[j]->getDisplayName();
37 auto ssu_pt = make_unique<SupportSystemReliabilityUnit>(topNode);
38 ssu_pt->setDisplayName(topNode);
39 ssu_pt->updateFailureProbability();
40 int initialSupportSystemState = support_systems_state_array[j]->getDisplayedSupportSystemOperationalState();
41 ssu_pt->setInitialSupportSystemState(initialSupportSystemState);
42 ssu_pt->setBothTotalTimeRequiredAndRemainingTime(0.0);
45 ssu_pt->setCorrespondingSupportSystemPt(support_systems_state_array[j].get());
46 std::vector<string> nodes = ssu_pt->getBasicNodes();
48 for (std::vector<string>::iterator it = nodes.begin(); it != nodes.end(); ++it) {
62 unit->updateDisplayState();
67 bool need_to_check =
false;
73 activation_state = ssu->checkAndActivateSupportSystemFailure();
99 auto ptr = make_unique<SupportSystemReliabilityUnit>(src->getTopNode());
100 ptr->setDisplayName(src->getTopNode());
101 ptr->copySupportSystemUnit(*src);
114 fout <<
"SupportSystemReliabilityModule\n" << num <<
'\n';
115 for (i = 0; i < num; i++) {
125 if (str !=
"SupportSystemReliabilityModule") {
126 ofstream fout(
"err messages.txt", ios::app);
128 <<
"SupportSystemReliabilityModule::retrieveSupportSystemModuleFromFile in previous function"
131 <<
"SupportSystemReliabilityModule::retrieveSupportSystemModuleFromFile error in previous function\n";
135 "SupportSystemReliabilityModule::retrieveSupportSystemModuleFromFile Prior error.");
139 for (i = 0; i < num; i++) {
141 auto ssu_pt = make_unique<SupportSystemReliabilityUnit>(str);
142 ssu_pt->retrieveSupportSystemUnitFromFile(fin);
152 if(p->getTopNode() == name){
156 ofstream fout(
"err messages.txt", ios::app);
157 cout <<
"SupportSystemReliabilityModule::getSupportSystemReliabilityUnit "
159 <<
" can not be found." << endl;
160 fout <<
r5pars_.timesno <<
" SupportSystemReliabilityModule::getSupportSystemReliabilityUnit "
162 <<
" can not be found.\n";
SimulationContext g_sim
Global simulation context: the single instance, defined in SimulationContext.cpp.
Support system reliability — models auxiliary system failures (power, cooling, instrumentation).
void setTempTypeOfConsequence(Consequence)
Stores the consequence of the end state the running sequence will get.
void addSSReliabilityBranch(BranchSupportSystemAction *, BranchSupportSystemAction *)
Registers a support system reliability fork with two alternatives (index 0 first)....
void setTempESMessage(std::string)
Stores the description of the end state the running sequence will get if it is terminated (set by mod...
void setFunctionalState(int)
void copyBranchSupportSystemAction(BranchSupportSystemAction &)
void setSenderAndReceiver(int, int)
const std::vector< std::unique_ptr< DisplaySupportSystemState > > & getSupport_systems_state_array() const
ControlPanelDisplay indicators
void setStateOfActivation(int)
void saveStateOfActivationToFile(std::ofstream &)
int getStateOfActivation()
void retrieveStateOfActivationFromFile(std::ifstream &)
void copyStateOfActivation(StateOfActivation &)
void resetStateOfActivation()
std::vector< std::unique_ptr< SupportSystemReliabilityUnit > > supportSystemReliabilityUnit
void retrieveSupportSystemModuleFromFile(std::ifstream &)
SupportSystemReliabilityModule()
void saveSupportSystemModuleToFile(std::ofstream &)
void updateSupportSystemDisplayStates()
const std::vector< std::unique_ptr< SupportSystemReliabilityUnit > > & getSupportSystemReliabilityUnit() const
virtual ~SupportSystemReliabilityModule()
void copySupportSystemModule(SupportSystemReliabilityModule &)
void checkAndActiveSupportSystemFailure()
void setTimerAndProbability(double, double)
constexpr int Reliability
ControlPanel Indicator
Control room panel state.
BranchRecord Branch_center
Dynamic event tree state.