← Documentation
ADS-IDAC Engine 5.0.0
HWReliabilityModule Class Reference

#include <HWReliabilityModule.h>

Inheritance diagram for HWReliabilityModule:
[legend]
Collaboration diagram for HWReliabilityModule:
[legend]

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
 

Detailed Description

Definition at line 26 of file HWReliabilityModule.h.

Constructor & Destructor Documentation

◆ HWReliabilityModule()

HWReliabilityModule::HWReliabilityModule ( )

Definition at line 20 of file HWReliabilityModule.cpp.

◆ ~HWReliabilityModule()

HWReliabilityModule::~HWReliabilityModule ( )
virtual

Definition at line 23 of file HWReliabilityModule.cpp.

References clearForRestart().

Here is the call graph for this function:

Member Function Documentation

◆ checkAndActiveComponentFailure()

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:

  • Failure on demand and fault tree units: a unit fires once, at the first call in which the displayed state of its component differs from the state recorded at load time (the demand). The module then registers a fork of two BranchSystemAction copies of the unit through BranchRecord::addHWReliabilityBranch(success, failure): success first (index 0, the alternative the running sequence continues on) with probability 1 - p, failure second with the unit's probability p. Both have sender and receiver sim::Source::Plant and timer -1.0. The demand time is stored on every running failure unit with the same display name.
  • Failure while running units: once such a unit has seen its own demand, it registers one fork per interval. Fork k (k = 1 .. number of intervals) is registered at the first call with simulation time above demand time + k * interval length; its failure probability is 1 - exp(-rate * k * interval length), measured from the demand, and the success alternative carries the complement. The demand time is the one stored by an on demand unit with the same display name; without such a unit it stays 0.0.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearForRestart()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyHWReliabilityModule()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getHWReliabilityFTUnit()

HWReliabilityFTUnit * HWReliabilityModule::getHWReliabilityFTUnit ( const std::string  )

Finds the fault tree unit whose top node has the given name.

Returns
Pointer owned by this module. When no unit matches, the error is logged, r5pars_.sim_err is set, the pending end state becomes Consequence::AdsSimErr and a null pointer is returned.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readSystemOperationReliabilityInfoFromFile()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readSystemReliabilityFTInfoFromFile()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readSystemReliabilityInfoFromFile()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ retrieveHWReliabilityModuleFromFile()

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().

Here is the call graph for this function:

◆ saveHWReliabilityModuleToFile()

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().

Here is the call graph for this function:

◆ serialize()

template<class Archive >
void HWReliabilityModule::serialize ( Archive &  ar,
const unsigned int  version 
)
inline

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 119 of file HWReliabilityModule.h.

Member Data Documentation

◆ component_operation_reliability

std::vector<std::unique_ptr<HWReliabilityUnit> > HWReliabilityModule::component_operation_reliability

◆ component_reliability

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().

◆ component_reliability_FT

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().


The documentation for this class was generated from the following files: