|
ADS-IDAC Engine 5.0.0
|
#include <HWReliabilityModule.h>
Public Member Functions | |
| HWReliabilityModule () | |
| virtual | ~HWReliabilityModule () |
| HWReliabilityFTUnit * | getHWReliabilityFTUnit (const std::string) |
| Finds the fault tree unit whose top node has the given name. More... | |
| void | readInfoFromFile () |
Loads SystemReliability.txt from the hardware reliability directory (Scheduler::getHardwareReliabilityDirectory()) by calling the three section readers in file order: failure on demand, failure while running, fault tree failure on demand. A file that cannot be opened is logged; the section readers then report the stream as malformed and no model is loaded. The control panel must be loaded first, because every entry is resolved against its displays and controls. More... | |
| void | readSystemReliabilityInfoFromFile (std::ifstream &) |
| Reads the failure on demand section into component_reliability. More... | |
| void | readSystemOperationReliabilityInfoFromFile (std::ifstream &) |
| Reads the failure while running section into component_operation_reliability. More... | |
| void | readSystemReliabilityFTInfoFromFile (std::ifstream &) |
| Reads the fault tree failure on demand section into component_reliability_FT. More... | |
| void | checkAndActiveComponentFailure () |
| Registers the hardware forks that are due at the current evaluation point. More... | |
| void | copyHWReliabilityModule (HWReliabilityModule &) |
| Appends deep copies of the units of another module and copies its state of activation. Existing units are kept, so call clearForRestart() first. More... | |
| void | clearForRestart () |
| Removes all units and resets the state of activation. More... | |
| void | saveHWReliabilityModuleToFile (std::ofstream &) |
| Writes the failure on demand units and the failure while running units, each under its own label and count, then the state of activation, to a text restart stream. Fault tree units are not written. More... | |
| void | retrieveHWReliabilityModuleFromFile (std::ifstream &) |
| Reads a text restart stream: checks the two section labels, loads the failure while running units and the state of activation. The failure on demand units that saveHWReliabilityModuleToFile() writes between the two labels are not consumed, so the two functions are symmetric only when that section is empty. A wrong label sets r5pars_.sim_err. More... | |
| template<class Archive > | |
| void | serialize (Archive &ar, const unsigned int version) |
Public Member Functions inherited from StateOfActivation | |
| StateOfActivation () | |
| virtual | ~StateOfActivation () |
| int | getStateOfActivation () |
| void | setStateOfActivation (int) |
| void | copyStateOfActivation (StateOfActivation &) |
| void | saveStateOfActivationToFile (std::ofstream &) |
| void | retrieveStateOfActivationFromFile (std::ifstream &) |
| void | resetStateOfActivation () |
| bool | checkIfIsIdenticalStateOfActivation (StateOfActivation &) |
| template<class Archive > | |
| void | serialize (Archive &ar, const unsigned int version) |
Public Attributes | |
| std::vector< std::unique_ptr< HWReliabilityUnit > > | component_reliability |
| Failure on demand units (alpha/beta probability model). More... | |
| std::vector< std::unique_ptr< HWReliabilityUnit > > | component_operation_reliability |
| Failure while running units (constant failure rate, evaluated per interval). More... | |
| std::vector< std::unique_ptr< HWReliabilityFTUnit > > | component_reliability_FT |
| Failure on demand units whose probability comes from a fault tree top node. More... | |
Friends | |
| class | boost::serialization::access |
Definition at line 26 of file HWReliabilityModule.h.
| HWReliabilityModule::HWReliabilityModule | ( | ) |
Definition at line 20 of file HWReliabilityModule.cpp.
|
virtual |
Definition at line 23 of file HWReliabilityModule.cpp.
References clearForRestart().
| void HWReliabilityModule::checkAndActiveComponentFailure | ( | ) |
Registers the hardware forks that are due at the current evaluation point.
Returns at once when the module is sim::State::Done. Otherwise:
The module sets itself sim::State::Done only when every unit has fired and every running failure unit has used all its intervals; while an interval is pending it keeps checking. The forks only take effect when BranchRecord::checkAndAddBranchCluster() runs afterwards in the same evaluation point.
Definition at line 431 of file HWReliabilityModule.cpp.
References sim::State::Active, BranchRecord::addHWReliabilityBranch(), SimulationContext::Branch_center, component_operation_reliability, component_reliability, component_reliability_FT, BranchSystemAction::copyBranchSystemAction(), sim::State::Done, sim::State::Failed, g_sim, Probability::getProbability(), StateOfActivation::getStateOfActivation(), sim::None, sim::Source::Plant, r5pars_, BranchSystemAction::setFunctionalState(), Communication::setSenderAndReceiver(), StateOfActivation::setStateOfActivation(), TimerAndProbability::setTimerAndProbability(), and sim::State::Succeed.
Referenced by AdsidacCallback::onEvaluationPoint().
| void HWReliabilityModule::clearForRestart | ( | ) |
Removes all units and resets the state of activation.
Definition at line 537 of file HWReliabilityModule.cpp.
References component_operation_reliability, component_reliability, component_reliability_FT, and StateOfActivation::resetStateOfActivation().
Referenced by AdsidacCallback::initiationForRestart(), and ~HWReliabilityModule().
| void HWReliabilityModule::copyHWReliabilityModule | ( | HWReliabilityModule & | _hwm | ) |
Appends deep copies of the units of another module and copies its state of activation. Existing units are kept, so call clearForRestart() first.
Definition at line 518 of file HWReliabilityModule.cpp.
References component_operation_reliability, component_reliability, component_reliability_FT, and StateOfActivation::copyStateOfActivation().
Referenced by AdsidacCallback::initiationForRestart(), and RestartNodeInfo::saveRestartNodeInfo().
| HWReliabilityFTUnit * HWReliabilityModule::getHWReliabilityFTUnit | ( | const std::string | ) |
Finds the fault tree unit whose top node has the given name.
Definition at line 593 of file HWReliabilityModule.cpp.
References AdsSimErr, SimulationContext::Branch_center, component_reliability_FT, g_sim, r5pars_, BranchRecord::setTempESMessage(), and BranchRecord::setTempTypeOfConsequence().
Referenced by ControlPanel::executeRequestToPlant(), and InitiatingEventFTUnit::readInfoFromFile().
| void HWReliabilityModule::readInfoFromFile | ( | ) |
Loads SystemReliability.txt from the hardware reliability directory (Scheduler::getHardwareReliabilityDirectory()) by calling the three section readers in file order: failure on demand, failure while running, fault tree failure on demand. A file that cannot be opened is logged; the section readers then report the stream as malformed and no model is loaded. The control panel must be loaded first, because every entry is resolved against its displays and controls.
Definition at line 26 of file HWReliabilityModule.cpp.
References g_sim, Scheduler::getHardwareReliabilityDirectory(), r5pars_, readSystemOperationReliabilityInfoFromFile(), readSystemReliabilityFTInfoFromFile(), readSystemReliabilityInfoFromFile(), and SimulationContext::SScheduler.
Referenced by AdsidacCallback::onFirstInit().
| void HWReliabilityModule::readSystemOperationReliabilityInfoFromFile | ( | std::ifstream & | ) |
Reads the failure while running section into component_operation_reliability.
Layout: a label token and the entry count, then per entry seven tokens: display name, control name, failure rate, interval length, number of intervals, recovery alpha, recovery beta. The initial failure probability is 1 - exp(-rate * interval length). Name resolution and the malformed-header handling are the same as in readSystemReliabilityInfoFromFile().
Definition at line 182 of file HWReliabilityModule.cpp.
References SimulationContext::Branch_center, sim::State::Close, component_operation_reliability, ControlPanelControl::control_state_array, ControlPanelControl::control_value_array, ControlPanel::controls, g_sim, ControlPanelControl::getControlFromMap(), DisplayComponentState::getDisplayedComponentOperationalState(), ControlState::getDisplayedControlStateWhenFail(), ControlValue::getDisplayedControlValueWhenFail(), ControlPanelDisplay::getDisplayFromMap(), ControlElement::getValueForNeutralState(), ControlElement::getValueForOffOrFullyClose(), ControlElement::getValueForOnOrFullyOpen(), SimulationContext::Indicator, ControlPanel::indicators, NoKB, sim::State::Off, sim::State::On, sim::State::Open, sim::Source::Plant, r5pars_, sim::Source::Reliability, Probability::setAlpha_Parameter(), Probability::setBeta_Parameter(), BranchRecord::setTempESMessage(), and BranchRecord::setTempTypeOfConsequence().
Referenced by readInfoFromFile().
| void HWReliabilityModule::readSystemReliabilityFTInfoFromFile | ( | std::ifstream & | ) |
Reads the fault tree failure on demand section into component_reliability_FT.
Layout: a label token and the entry count, then per entry <display name> <control name> <top node name>. The failure probability is taken from the fault tree top node (HWReliabilityFTUnit::updateFailureProbability()). The recovery parameters of the control are set to alpha 100000 and beta 1. Name resolution and the malformed-header handling are the same as in readSystemReliabilityInfoFromFile().
Definition at line 308 of file HWReliabilityModule.cpp.
References SimulationContext::Branch_center, sim::State::Close, component_reliability_FT, ControlPanelControl::control_state_array, ControlPanelControl::control_value_array, ControlPanel::controls, g_sim, ControlPanelControl::getControlFromMap(), DisplayComponentState::getDisplayedComponentOperationalState(), ControlState::getDisplayedControlStateWhenFail(), ControlValue::getDisplayedControlValueWhenFail(), ControlPanelDisplay::getDisplayFromMap(), ControlElement::getValueForNeutralState(), ControlElement::getValueForOffOrFullyClose(), ControlElement::getValueForOnOrFullyOpen(), SimulationContext::Indicator, ControlPanel::indicators, NoKB, sim::State::Off, sim::State::On, sim::State::Open, sim::Source::Plant, r5pars_, sim::Source::Reliability, Probability::setAlpha_Parameter(), Probability::setBeta_Parameter(), BranchRecord::setTempESMessage(), and BranchRecord::setTempTypeOfConsequence().
Referenced by readInfoFromFile().
| void HWReliabilityModule::readSystemReliabilityInfoFromFile | ( | std::ifstream & | ) |
Reads the failure on demand section into component_reliability.
Layout: a label token and the entry count, then per entry <display name> <control name> <failure alpha> <failure beta> <recovery alpha> <recovery beta>. The failure probability is the mean of the beta distribution, alpha / (alpha + beta) (Probability::calculateProbability()). The control value applied on failure is the control's value for its displayed state when failed (binary control) or its displayed value when failed (fine adjustment control); the recovery parameters are stored on that control. An unknown display or control name is logged and sets r5pars_.sim_err with Consequence::NoKB. If the section header cannot be read, a WARNING is printed, the rest of the file is not loaded and the function returns.
Definition at line 45 of file HWReliabilityModule.cpp.
References SimulationContext::Branch_center, sim::State::Close, component_reliability, ControlPanelControl::control_state_array, ControlPanelControl::control_value_array, ControlPanel::controls, g_sim, ControlPanelControl::getControlFromMap(), DisplayComponentState::getDisplayedComponentOperationalState(), ControlState::getDisplayedControlStateWhenFail(), ControlValue::getDisplayedControlValueWhenFail(), ControlPanelDisplay::getDisplayFromMap(), ControlElement::getValueForNeutralState(), ControlElement::getValueForOffOrFullyClose(), ControlElement::getValueForOnOrFullyOpen(), SimulationContext::Indicator, ControlPanel::indicators, NoKB, sim::State::Off, sim::State::On, sim::State::Open, sim::Source::Plant, r5pars_, sim::Source::Reliability, Probability::setAlpha_Parameter(), Probability::setBeta_Parameter(), BranchRecord::setTempESMessage(), and BranchRecord::setTempTypeOfConsequence().
Referenced by readInfoFromFile().
| void HWReliabilityModule::retrieveHWReliabilityModuleFromFile | ( | std::ifstream & | ) |
Reads a text restart stream: checks the two section labels, loads the failure while running units and the state of activation. The failure on demand units that saveHWReliabilityModuleToFile() writes between the two labels are not consumed, so the two functions are symmetric only when that section is empty. A wrong label sets r5pars_.sim_err.
Definition at line 559 of file HWReliabilityModule.cpp.
References SimulationContext::Branch_center, component_operation_reliability, g_sim, NoKB, r5pars_, StateOfActivation::retrieveStateOfActivationFromFile(), BranchRecord::setTempESMessage(), and BranchRecord::setTempTypeOfConsequence().
| void HWReliabilityModule::saveHWReliabilityModuleToFile | ( | std::ofstream & | ) |
Writes the failure on demand units and the failure while running units, each under its own label and count, then the state of activation, to a text restart stream. Fault tree units are not written.
Definition at line 543 of file HWReliabilityModule.cpp.
References component_operation_reliability, component_reliability, and StateOfActivation::saveStateOfActivationToFile().
|
inline |
Definition at line 121 of file HWReliabilityModule.h.
References component_operation_reliability, component_reliability, and component_reliability_FT.
|
friend |
Definition at line 119 of file HWReliabilityModule.h.
| std::vector<std::unique_ptr<HWReliabilityUnit> > HWReliabilityModule::component_operation_reliability |
Failure while running units (constant failure rate, evaluated per interval).
Definition at line 114 of file HWReliabilityModule.h.
Referenced by checkAndActiveComponentFailure(), clearForRestart(), copyHWReliabilityModule(), readSystemOperationReliabilityInfoFromFile(), retrieveHWReliabilityModuleFromFile(), saveHWReliabilityModuleToFile(), and serialize().
| std::vector<std::unique_ptr<HWReliabilityUnit> > HWReliabilityModule::component_reliability |
Failure on demand units (alpha/beta probability model).
Definition at line 112 of file HWReliabilityModule.h.
Referenced by checkAndActiveComponentFailure(), clearForRestart(), copyHWReliabilityModule(), readSystemReliabilityInfoFromFile(), saveHWReliabilityModuleToFile(), and serialize().
| std::vector<std::unique_ptr<HWReliabilityFTUnit> > HWReliabilityModule::component_reliability_FT |
Failure on demand units whose probability comes from a fault tree top node.
Definition at line 116 of file HWReliabilityModule.h.
Referenced by checkAndActiveComponentFailure(), clearForRestart(), copyHWReliabilityModule(), getHWReliabilityFTUnit(), readSystemReliabilityFTInfoFromFile(), and serialize().