|
ADS-IDAC Engine 5.0.0
|
One alternative of a BranchCluster, i.e. one PE node of the DET. More...
#include <BranchProbability.h>
Public Member Functions | |
| BranchProbability () | |
| Constructs an alternative with all IDs -999, unconditional probability -1.0 and child type sim::None. More... | |
| virtual | ~BranchProbability () |
| void | calculateProbability () |
| Sets the conditional probability to the product of the probabilities of every content item this alternative holds (1.0 when it holds none). New alarms do not contribute. More... | |
| void | setIDOfThisBranch (int) |
| void | setIDOfTheAssociatedBranchCluster (int) |
| void | setUnconditionalBranchProbability (double) |
| void | calUnconditionalBranchProbability (double) |
| Sets the unconditional probability to x times the conditional probability. More... | |
| int | getIDOfThisBranch () |
| int | getIDOfTheAssociatedBranchCluster () |
| double | getUnconditionalBranchProbability () |
| void | sendBranchInfoToCommandCenter (int) |
| Hands the content of this alternative to the command center (g_sim.Command_handler). This is the only function through which branch content reaches the command center. More... | |
| void | setTypeOfChild (int) |
| Sets the kind of node that follows this alternative: sim::Branch::Branch (a child cluster) or sim::Branch::EndState. More... | |
| int | getTypeOfChild () |
| void | saveInfoToFile (std::ostream &) |
| Writes the content of this alternative in the PE node text form (CommunicationPlace::saveInfoToFileAsBranchForADSV1). More... | |
| void | setIDOfTheChildBranchCluster (int) |
| Sets the ID of the node that follows this alternative: the child cluster ID, or the end state ID when the child type is sim::Branch::EndState. More... | |
| int | getIDOfTheChildBranchCluster () |
| void | copyBranchProbability (BranchProbability &) |
| Copies the IDs, probabilities, child type, state of activation and content of another alternative. child_IDs is not copied. More... | |
| void | saveBranchProbabilityToFile (std::ofstream &) |
| Writes the IDs, unconditional probability and child type, then the Probability, CommunicationPlace and StateOfActivation parts, to a text restart stream. child_IDs is not written. More... | |
| void | retrieveBranchProbabilityFromFile (std::ifstream &) |
| Reads the layout written by saveBranchProbabilityToFile. More... | |
| template<class Archive > | |
| void | serialize (Archive &ar, const unsigned int version) |
Public Member Functions inherited from Probability | |
| double | calculateProbability () |
| double | calculateSurvivalProbability (double) |
| double | gamma_log (double) |
| double | beta_cdf_inv (double, double, double) |
| double | beta_cdf (double, double, double) |
| double | beta_pdf (double, double, double) |
| double | beta_inc (double, double, double) |
| double | beta (double, double) |
| double | r8_huge () |
| double | r8_epsilon (void) |
| Probability () | |
| virtual | ~Probability () |
| void | setProbability (double) |
| double | getProbability () |
| void | setAlpha_Parameter (double) |
| double | getAlpha_Parameter () |
| void | setBeta_Parameter (double) |
| double | getBeta_Parameter () |
| void | copyProbability (Probability &) |
| void | saveProbabilityToFile (std::ofstream &) |
| void | retrieveProbabilityFromFile (std::ifstream &) |
| double | getFailureRate () const |
| void | setFailureRate (double failure_rate) |
| template<class Archive > | |
| void | serialize (Archive &ar, const unsigned int version) |
Public Member Functions inherited from CommunicationPlace | |
| CommunicationPlace () | |
| virtual | ~CommunicationPlace () |
| void | clearCommunicationPlaceAll () |
| void | clearCommunicationPlaceAllPointers () |
| void | clearCommunicationPlaceForRestart () |
| int | getTotalPiecesOfInfo () |
| void | updateSenderReceiverInfo () |
| void | copyCommunicationPlace (CommunicationPlace &) |
| void | saveInfoToFileAsBranchForADSV1 (std::ostream &) |
| int | getNumberOfItemInCommunicationPlace () |
| void | saveCommunicationPlaceToFile (std::ofstream &) |
| void | retrieveCommunicationPlaceFromFile (std::ifstream &) |
| template<class Archive > | |
| void | serialize (Archive &ar, const unsigned int version) |
Public Member Functions inherited from BranchUnit | |
| BranchUnit () | |
| virtual | ~BranchUnit () |
| void | clearBranchUnit () |
| void | clearBranchUnitAllPointers () |
| int | getTotalPiecesOfInfo () |
| void | calculateNumberOfCombination () |
| int | getNumberOfCombination () |
| int | getNumberOfItemInBranchUnit () |
| void | copyBranchUnit (BranchUnit &) |
| void | saveBranchUnitToFile (std::ofstream &) |
| void | retrieveBranchUnitFromFile (std::ifstream &) |
| 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< int > | child_IDs |
Public Attributes inherited from CommunicationPlace | |
| std::vector< std::shared_ptr< BranchSystemAction > > | HW_reliability |
| std::vector< std::shared_ptr< BranchSupportSystemAction > > | SS_reliability |
| std::vector< std::shared_ptr< BranchSystemAlarmState > > | new_alarm |
Public Attributes inherited from BranchUnit | |
| std::vector< std::shared_ptr< BranchGoal > > | goal |
| std::vector< std::shared_ptr< BranchStrategy > > | strategy |
| std::vector< std::shared_ptr< BranchSubGoal > > | subgoal |
| std::vector< std::shared_ptr< BranchDiagnosis > > | diagnosis |
| std::vector< std::shared_ptr< BranchActionObjective > > | action_objective |
| std::vector< std::shared_ptr< BranchActionPack > > | action_pack |
| std::vector< std::shared_ptr< BranchAction > > | action |
| std::vector< std::shared_ptr< BranchExpectedAlarmState > > | alarm_state |
| std::vector< std::shared_ptr< BranchExpectedComponentState > > | component_state |
| std::vector< std::shared_ptr< BranchExpectedSupportSystemState > > | support_system_state |
| std::vector< std::shared_ptr< BranchExpectedParameterTrend > > | parameter_trend |
| std::vector< std::shared_ptr< BranchExpectedParameterValue > > | parameter_value |
| std::vector< std::shared_ptr< BranchExpectedParameterDifference > > | parameter_difference |
| std::vector< std::shared_ptr< BranchProcedureStep > > | procedure_step |
| std::vector< std::shared_ptr< BranchProcedureStep > > | instinctive_response_procedure |
| std::vector< std::shared_ptr< BranchInfoGatherMode > > | info_gather_mode |
| std::vector< std::shared_ptr< BranchExpectedMentalBelief > > | mental_belief |
| std::vector< std::shared_ptr< BranchScannedParameter > > | scanned_parameter |
Private Attributes | |
| int | ID_of_this_branch |
| int | ID_of_the_associated_branch_cluster |
| int | ID_of_the_child_branch_cluster |
| double | unconditional_branch_probability |
| int | type_of_child |
Friends | |
| class | boost::serialization::access |
One alternative of a BranchCluster, i.e. one PE node of the DET.
The content of the alternative (goals, actions, expected states, procedure steps, hardware and support system actions, new alarms, ...) lives in the CommunicationPlace base. The Probability base holds the conditional probability of the alternative within its cluster. BranchRecord sets the StateOfActivation base to sim::State::Succeed after it sends the content to the command center.
Definition at line 43 of file BranchProbability.h.
| BranchProbability::BranchProbability | ( | ) |
Constructs an alternative with all IDs -999, unconditional probability -1.0 and child type sim::None.
Definition at line 20 of file BranchProbability.cpp.
References ID_of_the_associated_branch_cluster, ID_of_the_child_branch_cluster, ID_of_this_branch, sim::None, type_of_child, and unconditional_branch_probability.
|
virtual |
Definition at line 28 of file BranchProbability.cpp.
References child_IDs, and CommunicationPlace::clearCommunicationPlaceAll().
| void BranchProbability::calculateProbability | ( | ) |
Sets the conditional probability to the product of the probabilities of every content item this alternative holds (1.0 when it holds none). New alarms do not contribute.
Definition at line 32 of file BranchProbability.cpp.
References BranchUnit::action, BranchUnit::action_objective, BranchUnit::action_pack, BranchUnit::alarm_state, BranchUnit::component_state, BranchUnit::diagnosis, e, BranchUnit::goal, CommunicationPlace::HW_reliability, BranchUnit::info_gather_mode, BranchUnit::instinctive_response_procedure, BranchUnit::mental_belief, BranchUnit::parameter_difference, BranchUnit::parameter_trend, BranchUnit::parameter_value, BranchUnit::procedure_step, BranchUnit::scanned_parameter, Probability::setProbability(), CommunicationPlace::SS_reliability, BranchUnit::strategy, BranchUnit::subgoal, and BranchUnit::support_system_state.
| void BranchProbability::calUnconditionalBranchProbability | ( | double | x | ) |
Sets the unconditional probability to x times the conditional probability.
| x | Unconditional probability of the cluster this alternative belongs to. |
Definition at line 61 of file BranchProbability.cpp.
References Probability::getProbability(), and unconditional_branch_probability.
| void BranchProbability::copyBranchProbability | ( | BranchProbability & | _bp | ) |
Copies the IDs, probabilities, child type, state of activation and content of another alternative. child_IDs is not copied.
Definition at line 367 of file BranchProbability.cpp.
References CommunicationPlace::copyCommunicationPlace(), Probability::copyProbability(), StateOfActivation::copyStateOfActivation(), getIDOfTheAssociatedBranchCluster(), getIDOfTheChildBranchCluster(), getIDOfThisBranch(), getTypeOfChild(), getUnconditionalBranchProbability(), ID_of_the_associated_branch_cluster, ID_of_the_child_branch_cluster, ID_of_this_branch, type_of_child, and unconditional_branch_probability.
| int BranchProbability::getIDOfTheAssociatedBranchCluster | ( | ) |
Definition at line 65 of file BranchProbability.cpp.
References ID_of_the_associated_branch_cluster.
Referenced by copyBranchProbability().
| int BranchProbability::getIDOfTheChildBranchCluster | ( | ) |
Definition at line 351 of file BranchProbability.cpp.
References ID_of_the_child_branch_cluster.
Referenced by copyBranchProbability().
| int BranchProbability::getIDOfThisBranch | ( | ) |
Definition at line 64 of file BranchProbability.cpp.
References ID_of_this_branch.
Referenced by copyBranchProbability(), and BranchRecord::sendSpecifiedBranchCommandToCommandCenter().
| int BranchProbability::getTypeOfChild | ( | ) |
Definition at line 346 of file BranchProbability.cpp.
References type_of_child.
Referenced by copyBranchProbability().
| double BranchProbability::getUnconditionalBranchProbability | ( | ) |
Definition at line 67 of file BranchProbability.cpp.
References unconditional_branch_probability.
Referenced by BranchRecord::checkAndAddBranchCluster(), copyBranchProbability(), and AdsidacCallback::initiationForRestart().
| void BranchProbability::retrieveBranchProbabilityFromFile | ( | std::ifstream & | ) |
Reads the layout written by saveBranchProbabilityToFile.
Definition at line 360 of file BranchProbability.cpp.
References ID_of_the_associated_branch_cluster, ID_of_the_child_branch_cluster, ID_of_this_branch, CommunicationPlace::retrieveCommunicationPlaceFromFile(), Probability::retrieveProbabilityFromFile(), StateOfActivation::retrieveStateOfActivationFromFile(), type_of_child, and unconditional_branch_probability.
| void BranchProbability::saveBranchProbabilityToFile | ( | std::ofstream & | ) |
Writes the IDs, unconditional probability and child type, then the Probability, CommunicationPlace and StateOfActivation parts, to a text restart stream. child_IDs is not written.
Definition at line 352 of file BranchProbability.cpp.
References ID_of_the_associated_branch_cluster, ID_of_the_child_branch_cluster, ID_of_this_branch, CommunicationPlace::saveCommunicationPlaceToFile(), Probability::saveProbabilityToFile(), StateOfActivation::saveStateOfActivationToFile(), type_of_child, and unconditional_branch_probability.
| void BranchProbability::saveInfoToFile | ( | std::ostream & | ) |
Writes the content of this alternative in the PE node text form (CommunicationPlace::saveInfoToFileAsBranchForADSV1).
Definition at line 347 of file BranchProbability.cpp.
References CommunicationPlace::saveInfoToFileAsBranchForADSV1().
| void BranchProbability::sendBranchInfoToCommandCenter | ( | int | _associate_branch_ID | ) |
Hands the content of this alternative to the command center (g_sim.Command_handler). This is the only function through which branch content reaches the command center.
| _associate_branch_ID | Branch ID recorded on every command created from this alternative. |
Every content item is passed as a shared pointer, so the command center and this alternative share the item. The items sent are: goals, strategies, subgoals, diagnoses, action objectives, action packs, scanned parameters, actions, expected alarm, component and support system states, expected parameter trends, values and differences, procedure steps, instinctive response procedures, information gather modes, mental beliefs, hardware reliability actions, support system reliability actions and new alarms.
Before an item is sent its timer (total time required and remaining time) is set. The multiplier m is the scheduler's action time multiplier of the item's sender (ODM, OAT or OCT), or 1.0 for any other sender:
The scaling is applied in place to the shared items, so a second call on the same alternative scales the remaining-time items again. The function does not change the state of activation.
Definition at line 68 of file BranchProbability.cpp.
References BranchUnit::action, BranchUnit::action_objective, BranchUnit::action_pack, SimulationContext::Action_Taker, CommandControlCenter::addAction(), CommandControlCenter::addActionObjective(), CommandControlCenter::addActionPack(), CommandControlCenter::addDiagnosis(), CommandControlCenter::addExpectedAlarmState(), CommandControlCenter::addExpectedComponentState(), CommandControlCenter::addExpectedParameterDifference(), CommandControlCenter::addExpectedParameterTrend(), CommandControlCenter::addExpectedParameterValue(), CommandControlCenter::addExpectedSupportSystemState(), CommandControlCenter::addGoal(), CommandControlCenter::addHWReliability(), CommandControlCenter::addInfoGatherMode(), CommandControlCenter::addInstinctiveResponseProcedure(), CommandControlCenter::addMentalBelief(), CommandControlCenter::addNewAlarm(), CommandControlCenter::addProcedureStep(), CommandControlCenter::addScannedParameter(), CommandControlCenter::addSSReliability(), CommandControlCenter::addStrategy(), CommandControlCenter::addSubGoal(), BranchUnit::alarm_state, SimulationContext::Command_handler, BranchUnit::component_state, SimulationContext::Decision_Maker, BranchUnit::diagnosis, e, g_sim, Operator::getNominalCommunicationTime(), Scheduler::getOATActionTimeMultiplier(), Scheduler::getOCTActionTimeMultiplier(), Scheduler::getODMActionTimeMultiplier(), BranchUnit::goal, CommunicationPlace::HW_reliability, BranchUnit::info_gather_mode, BranchUnit::instinctive_response_procedure, BranchUnit::mental_belief, CommunicationPlace::new_alarm, sim::Operator::OAT, sim::Operator::OCT, sim::Operator::ODM, BranchUnit::parameter_difference, BranchUnit::parameter_trend, BranchUnit::parameter_value, sim::Source::Plant, BranchUnit::procedure_step, BranchUnit::scanned_parameter, CommunicationPlace::SS_reliability, SimulationContext::SScheduler, BranchUnit::strategy, BranchUnit::subgoal, and BranchUnit::support_system_state.
Referenced by AdsidacCallback::initiationForRestart(), and BranchRecord::sendSpecifiedBranchCommandToCommandCenter().
|
inline |
Definition at line 129 of file BranchProbability.h.
References child_IDs, ID_of_the_associated_branch_cluster, ID_of_the_child_branch_cluster, ID_of_this_branch, type_of_child, and unconditional_branch_probability.
| void BranchProbability::setIDOfTheAssociatedBranchCluster | ( | int | n | ) |
Definition at line 58 of file BranchProbability.cpp.
References ID_of_the_associated_branch_cluster.
| void BranchProbability::setIDOfTheChildBranchCluster | ( | int | n | ) |
Sets the ID of the node that follows this alternative: the child cluster ID, or the end state ID when the child type is sim::Branch::EndState.
Definition at line 350 of file BranchProbability.cpp.
References ID_of_the_child_branch_cluster.
Referenced by BranchRecord::addAnEndState(), and BranchRecord::checkAndAddBranchCluster().
| void BranchProbability::setIDOfThisBranch | ( | int | n | ) |
Definition at line 57 of file BranchProbability.cpp.
References ID_of_this_branch.
Referenced by AdsidacCallback::initiationForRestart().
| void BranchProbability::setTypeOfChild | ( | int | n | ) |
Sets the kind of node that follows this alternative: sim::Branch::Branch (a child cluster) or sim::Branch::EndState.
Definition at line 345 of file BranchProbability.cpp.
References type_of_child.
Referenced by BranchRecord::addAnEndState(), and BranchRecord::checkAndAddBranchCluster().
| void BranchProbability::setUnconditionalBranchProbability | ( | double | x | ) |
Definition at line 60 of file BranchProbability.cpp.
References unconditional_branch_probability.
|
friend |
Definition at line 127 of file BranchProbability.h.
| std::vector<int> BranchProbability::child_IDs |
IDs of the nodes that follow this alternative: the branch IDs of the child cluster's alternatives as they are created, or the end state ID.
Definition at line 126 of file BranchProbability.h.
Referenced by BranchRecord::addAnEndState(), BranchRecord::checkAndAddBranchCluster(), AdsidacCallback::initiationForRestart(), serialize(), and ~BranchProbability().
|
private |
Definition at line 144 of file BranchProbability.h.
Referenced by BranchProbability(), copyBranchProbability(), getIDOfTheAssociatedBranchCluster(), retrieveBranchProbabilityFromFile(), saveBranchProbabilityToFile(), serialize(), and setIDOfTheAssociatedBranchCluster().
|
private |
Definition at line 145 of file BranchProbability.h.
Referenced by BranchProbability(), copyBranchProbability(), getIDOfTheChildBranchCluster(), retrieveBranchProbabilityFromFile(), saveBranchProbabilityToFile(), serialize(), and setIDOfTheChildBranchCluster().
|
private |
Definition at line 143 of file BranchProbability.h.
Referenced by BranchProbability(), copyBranchProbability(), getIDOfThisBranch(), retrieveBranchProbabilityFromFile(), saveBranchProbabilityToFile(), serialize(), and setIDOfThisBranch().
|
private |
Definition at line 147 of file BranchProbability.h.
Referenced by BranchProbability(), copyBranchProbability(), getTypeOfChild(), retrieveBranchProbabilityFromFile(), saveBranchProbabilityToFile(), serialize(), and setTypeOfChild().
|
private |
Definition at line 146 of file BranchProbability.h.
Referenced by BranchProbability(), calUnconditionalBranchProbability(), copyBranchProbability(), getUnconditionalBranchProbability(), retrieveBranchProbabilityFromFile(), saveBranchProbabilityToFile(), serialize(), and setUnconditionalBranchProbability().