|
ADS-IDAC Engine 5.0.0
|
The end state (ES node) that terminates one sequence of the DET. More...
#include <BranchEndState.h>
Public Member Functions | |
| BranchEndState () | |
| Constructs an end state with consequence Consequence::NoKB, both IDs sim::None and the description "NONE". More... | |
| virtual | ~BranchEndState () |
| void | setTypeOfConsequence (Consequence) |
| void | setIDOfThisEndState (int) |
| Sets the end state ID. It is also the sequence ID used in the ZESNode file name. More... | |
| void | setConsequenceDescription (std::string) |
| void | setIDOfTheMotherBranch (int) |
| Sets the ID of the branch (PE node) this end state hangs from. More... | |
| int | getIDOfTheMotherBranch () |
| Consequence | getTypeOfConsequence () |
| int | getIDOfThisEndState () |
| std::string | getConsequenceDescription () |
| void | saveInfoToFile () |
| Writes this end state as an ES node file, overwriting any existing file. More... | |
| void | copyBranchEndState (BranchEndState &) |
| Copies every field, including the Time and Probability parts. More... | |
| void | saveBranchEndStateToFile (std::ofstream &) |
Writes the end state to a text restart stream as <consequence as int> <id> <mother branch id> <description>, followed by the Time and Probability parts. The description is written unquoted. More... | |
| void | retrieveBranchEndStateFromFile (std::ifstream &) |
Reads the layout written by saveBranchEndStateToFile. The description is read with >>, so it is a single whitespace-delimited token. More... | |
| void | retrieveBranchEndStateFromFile (std::string strFileName) |
| Loads an end state from an ES node file written by saveInfoToFile. More... | |
| template<class Archive > | |
| void | serialize (Archive &ar, const unsigned int version) |
Public Member Functions inherited from Time | |
| Time () | |
| virtual | ~Time () |
| double | getTimeAtWhichThisEventHappen () const |
| void | setTimeAtWhichThisEventHappen (double) |
| void | copyTime (Time &) |
| void | saveTimeToFile (std::ofstream &) |
| void | retrieveTimeFromFile (std::ifstream &) |
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) |
Private Attributes | |
| Consequence | type_of_consequence |
| int | ID_this_end_state |
| int | ID_of_the_mother_branch |
| std::string | consequence_description |
Friends | |
| class | boost::serialization::access |
The end state (ES node) that terminates one sequence of the DET.
Inherits from Time (the simulation time at which the sequence ended) and Probability (the unconditional probability of the sequence).
Definition at line 25 of file BranchEndState.h.
| BranchEndState::BranchEndState | ( | ) |
Constructs an end state with consequence Consequence::NoKB, both IDs sim::None and the description "NONE".
Definition at line 30 of file BranchEndState.cpp.
References consequence_description, ID_of_the_mother_branch, ID_this_end_state, NoKB, sim::None, and type_of_consequence.
|
virtual |
Definition at line 38 of file BranchEndState.cpp.
| void BranchEndState::copyBranchEndState | ( | BranchEndState & | _bes | ) |
Copies every field, including the Time and Probability parts.
Definition at line 90 of file BranchEndState.cpp.
References consequence_description, Probability::copyProbability(), Time::copyTime(), getConsequenceDescription(), getIDOfTheMotherBranch(), getIDOfThisEndState(), getTypeOfConsequence(), ID_of_the_mother_branch, ID_this_end_state, and type_of_consequence.
| string BranchEndState::getConsequenceDescription | ( | ) |
Definition at line 47 of file BranchEndState.cpp.
References consequence_description.
Referenced by copyBranchEndState().
| int BranchEndState::getIDOfTheMotherBranch | ( | ) |
Definition at line 49 of file BranchEndState.cpp.
References ID_of_the_mother_branch.
Referenced by copyBranchEndState().
| int BranchEndState::getIDOfThisEndState | ( | ) |
Definition at line 46 of file BranchEndState.cpp.
References ID_this_end_state.
Referenced by BranchRecord::addAnEndState(), and copyBranchEndState().
| Consequence BranchEndState::getTypeOfConsequence | ( | ) |
Definition at line 45 of file BranchEndState.cpp.
References type_of_consequence.
Referenced by copyBranchEndState().
| void BranchEndState::retrieveBranchEndStateFromFile | ( | std::ifstream & | ) |
Reads the layout written by saveBranchEndStateToFile. The description is read with >>, so it is a single whitespace-delimited token.
| void BranchEndState::retrieveBranchEndStateFromFile | ( | std::string | strFileName | ) |
Loads an end state from an ES node file written by saveInfoToFile.
| strFileName | Path of the ZESNode file. |
Restores the end time, ID, probability, consequence and description. The mother branch ID in the file is skipped, so ID_of_the_mother_branch keeps its previous value. The description is stored with its surrounding double quotes.
| void BranchEndState::saveBranchEndStateToFile | ( | std::ofstream & | ) |
Writes the end state to a text restart stream as <consequence as int> <id> <mother branch id> <description>, followed by the Time and Probability parts. The description is written unquoted.
Definition at line 79 of file BranchEndState.cpp.
References consequence_description, ID_of_the_mother_branch, ID_this_end_state, Probability::saveProbabilityToFile(), Time::saveTimeToFile(), and type_of_consequence.
| void BranchEndState::saveInfoToFile | ( | ) |
Writes this end state as an ES node file, overwriting any existing file.
File name, with <ES dir> = Scheduler::getESDirectory():
<ES dir>ESFolder_<id / subfolder size>/ZESNode_<id>.txt, where the subfolder size is BranchRecord::getSizeOfSubFolder(); the folder is created on demand.<ES dir>ZESNode_<id>.txt.The full name is also stored in the scheduler (Scheduler::setFileNameES).
File content (three lines, no trailing newline):
The stream is closed with checked_close: a failed write is reported on stderr and appended to "err messages.txt"; the function itself returns nothing.
Definition at line 50 of file BranchEndState.cpp.
References SimulationContext::Branch_center, checked_close(), consequence_description, Console, g_sim, Scheduler::getESDirectory(), Probability::getProbability(), BranchRecord::getSizeOfSubFolder(), Time::getTimeAtWhichThisEventHappen(), ID_of_the_mother_branch, ID_this_end_state, r5pars_, Scheduler::setFileNameES(), SimulationContext::SScheduler, and type_of_consequence.
Referenced by BranchRecord::addAnEndState().
|
inline |
Definition at line 81 of file BranchEndState.h.
References consequence_description, ID_of_the_mother_branch, ID_this_end_state, and type_of_consequence.
| void BranchEndState::setConsequenceDescription | ( | std::string | ) |
Definition at line 44 of file BranchEndState.cpp.
References consequence_description.
Referenced by Scheduler::checkForTerminatingCurrentSequence(), OperatorDM::infoChunking(), main(), AdsidacCallback::onEvaluationPoint(), and OperatorDM::performFollowProcedureStrategy().
| void BranchEndState::setIDOfTheMotherBranch | ( | int | n | ) |
Sets the ID of the branch (PE node) this end state hangs from.
Definition at line 48 of file BranchEndState.cpp.
References ID_of_the_mother_branch.
Referenced by BranchRecord::addAnEndState().
| void BranchEndState::setIDOfThisEndState | ( | int | n | ) |
Sets the end state ID. It is also the sequence ID used in the ZESNode file name.
Definition at line 43 of file BranchEndState.cpp.
References ID_this_end_state.
Referenced by BranchRecord::addAnEndState().
| void BranchEndState::setTypeOfConsequence | ( | Consequence | n | ) |
Definition at line 42 of file BranchEndState.cpp.
References type_of_consequence.
Referenced by Scheduler::checkForTerminatingCurrentSequence(), OperatorDM::infoChunking(), main(), AdsidacCallback::onEvaluationPoint(), and OperatorDM::performFollowProcedureStrategy().
|
friend |
Definition at line 79 of file BranchEndState.h.
|
private |
Definition at line 94 of file BranchEndState.h.
Referenced by BranchEndState(), copyBranchEndState(), getConsequenceDescription(), saveBranchEndStateToFile(), saveInfoToFile(), serialize(), and setConsequenceDescription().
|
private |
Definition at line 93 of file BranchEndState.h.
Referenced by BranchEndState(), copyBranchEndState(), getIDOfTheMotherBranch(), saveBranchEndStateToFile(), saveInfoToFile(), serialize(), and setIDOfTheMotherBranch().
|
private |
Definition at line 92 of file BranchEndState.h.
Referenced by BranchEndState(), copyBranchEndState(), getIDOfThisEndState(), saveBranchEndStateToFile(), saveInfoToFile(), serialize(), and setIDOfThisEndState().
|
private |
Definition at line 91 of file BranchEndState.h.
Referenced by BranchEndState(), copyBranchEndState(), getTypeOfConsequence(), saveBranchEndStateToFile(), saveInfoToFile(), serialize(), and setTypeOfConsequence().