← Documentation
ADS-IDAC Engine 5.0.0
BranchEndState Class Reference

The end state (ES node) that terminates one sequence of the DET. More...

#include <BranchEndState.h>

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

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ BranchEndState()

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.

◆ ~BranchEndState()

BranchEndState::~BranchEndState ( )
virtual

Definition at line 38 of file BranchEndState.cpp.

Member Function Documentation

◆ copyBranchEndState()

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.

Here is the call graph for this function:

◆ getConsequenceDescription()

string BranchEndState::getConsequenceDescription ( )

Definition at line 47 of file BranchEndState.cpp.

References consequence_description.

Referenced by copyBranchEndState().

Here is the caller graph for this function:

◆ getIDOfTheMotherBranch()

int BranchEndState::getIDOfTheMotherBranch ( )

Definition at line 49 of file BranchEndState.cpp.

References ID_of_the_mother_branch.

Referenced by copyBranchEndState().

Here is the caller graph for this function:

◆ getIDOfThisEndState()

int BranchEndState::getIDOfThisEndState ( )

Definition at line 46 of file BranchEndState.cpp.

References ID_this_end_state.

Referenced by BranchRecord::addAnEndState(), and copyBranchEndState().

Here is the caller graph for this function:

◆ getTypeOfConsequence()

Consequence BranchEndState::getTypeOfConsequence ( )

Definition at line 45 of file BranchEndState.cpp.

References type_of_consequence.

Referenced by copyBranchEndState().

Here is the caller graph for this function:

◆ retrieveBranchEndStateFromFile() [1/2]

void BranchEndState::retrieveBranchEndStateFromFile ( std::ifstream &  )

Reads the layout written by saveBranchEndStateToFile. The description is read with >>, so it is a single whitespace-delimited token.

◆ retrieveBranchEndStateFromFile() [2/2]

void BranchEndState::retrieveBranchEndStateFromFile ( std::string  strFileName)

Loads an end state from an ES node file written by saveInfoToFile.

Parameters
strFileNamePath 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.

◆ saveBranchEndStateToFile()

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.

Here is the call graph for this function:

◆ saveInfoToFile()

void BranchEndState::saveInfoToFile ( )

Writes this end state as an ES node file, overwriting any existing file.

File name, with <ES dir> = Scheduler::getESDirectory():

The full name is also stored in the scheduler (Scheduler::setFileNameES).

File content (three lines, no trailing newline):

ES_<id> <end time> <id> <mother branch id> 0 3096 0 <probability>
"<consequence description>"
Consequence
Definition: SimConstants.h:27
double probability
Definition: Probability.h:56

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

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

◆ serialize()

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

◆ setConsequenceDescription()

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

Here is the caller graph for this function:

◆ setIDOfTheMotherBranch()

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

Here is the caller graph for this function:

◆ setIDOfThisEndState()

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

Here is the caller graph for this function:

◆ setTypeOfConsequence()

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

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 79 of file BranchEndState.h.

Member Data Documentation

◆ consequence_description

std::string BranchEndState::consequence_description
private

◆ ID_of_the_mother_branch

int BranchEndState::ID_of_the_mother_branch
private

◆ ID_this_end_state

int BranchEndState::ID_this_end_state
private

◆ type_of_consequence

Consequence BranchEndState::type_of_consequence
private

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