← Documentation
ADS-IDAC Engine 5.0.0
BranchProcedureControlValue Class Reference

Table of procedure actions that branch on the control value they set. More...

#include <BranchProcedureControlValue.h>

Public Member Functions

 BranchProcedureControlValue ()
 
virtual ~BranchProcedureControlValue ()
 
BranchProcedureControlValueUnit * checkToGenerateControlValueBranches (std::string, std::string, std::string)
 Looks up the control value branch definition of a procedure action. More...
 
void clearBranchProcedureControlValue ()
 Removes every entry. More...
 
void copyBranchProcedureControlValue (BranchProcedureControlValue &)
 Appends deep copies of the entries of another table. Existing entries are kept, so call it on an empty table. More...
 
void readInfoFromFile ()
 Loads ProcedureControlValueBranches.txt from the EOP directory (Scheduler::getEOPDirectory()) and appends its entries. More...
 
void saveBranchProcedureControlValueToFile (std::ofstream &)
 Writes the label BranchProcedureControlValue, the entry count and every entry to a text restart stream. More...
 
void retreiveBranchProcedureControlValueFromFile (std::ifstream &)
 Reads the layout written by saveBranchProcedureControlValueToFile and appends the entries it reads. More...
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Public Attributes

std::vector< std::unique_ptr< BranchProcedureControlValueUnit > > control_value_branches
 The entries, in file order. More...
 

Detailed Description

Table of procedure actions that branch on the control value they set.

Each entry (BranchProcedureControlValueUnit) names one procedure action by (procedure, step, action) and lists the alternative control values with their probabilities. When a procedure step executes an action that has an entry, the step generates one branch alternative per listed value (times the action-time branches) instead of the single value the action would otherwise set. The table only answers the lookup; the branches themselves are built by ProcedureStepUnit.

Definition at line 29 of file BranchProcedureControlValue.h.

Constructor & Destructor Documentation

◆ BranchProcedureControlValue()

BranchProcedureControlValue::BranchProcedureControlValue ( )

Definition at line 17 of file BranchProcedureControlValue.cpp.

◆ ~BranchProcedureControlValue()

BranchProcedureControlValue::~BranchProcedureControlValue ( )
virtual

Definition at line 22 of file BranchProcedureControlValue.cpp.

References clearBranchProcedureControlValue().

Here is the call graph for this function:

Member Function Documentation

◆ checkToGenerateControlValueBranches()

BranchProcedureControlValueUnit * BranchProcedureControlValue::checkToGenerateControlValueBranches ( std::string  ,
std::string  ,
std::string   
)

Looks up the control value branch definition of a procedure action.

The three arguments are, in order: the procedure name, the step name within that procedure, and the name of the control the action operates (the action's info name).

Returns
The first entry whose three names all match exactly, owned by this table, or a null pointer when the action does not branch on its control value.

Definition at line 27 of file BranchProcedureControlValue.cpp.

References control_value_branches.

Referenced by ProcedureStepUnit::executeAction(), and ProcedureStepUnit::executeNonResponseAction().

Here is the caller graph for this function:

◆ clearBranchProcedureControlValue()

void BranchProcedureControlValue::clearBranchProcedureControlValue ( )

Removes every entry.

Definition at line 45 of file BranchProcedureControlValue.cpp.

References control_value_branches.

Referenced by BranchRecord::clearBranchRecordAll(), and ~BranchProcedureControlValue().

Here is the caller graph for this function:

◆ copyBranchProcedureControlValue()

void BranchProcedureControlValue::copyBranchProcedureControlValue ( BranchProcedureControlValue &  _bpcv)

Appends deep copies of the entries of another table. Existing entries are kept, so call it on an empty table.

Definition at line 50 of file BranchProcedureControlValue.cpp.

References control_value_branches.

Referenced by BranchRecord::copyBranchRecord().

Here is the caller graph for this function:

◆ readInfoFromFile()

void BranchProcedureControlValue::readInfoFromFile ( )

Loads ProcedureControlValueBranches.txt from the EOP directory (Scheduler::getEOPDirectory()) and appends its entries.

Layout: a label token and the entry count, then for each entry <procedure> <step> <action> <number of branches> followed by that many <control value> <probability> pairs. An entry whose probabilities do not sum to 1.0 within 1e-4 is still loaded; the mismatch is logged. A missing file is logged to stdout and "err messages.txt" and leaves the table unchanged (no action branches on its control value).

Definition at line 60 of file BranchProcedureControlValue.cpp.

References control_value_branches, g_sim, Scheduler::getEOPDirectory(), r5pars_, and SimulationContext::SScheduler.

Referenced by BranchRecord::initiationForSimulation().

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

◆ retreiveBranchProcedureControlValueFromFile()

void BranchProcedureControlValue::retreiveBranchProcedureControlValueFromFile ( std::ifstream &  )

Reads the layout written by saveBranchProcedureControlValueToFile and appends the entries it reads.

Definition at line 95 of file BranchProcedureControlValue.cpp.

References control_value_branches.

Referenced by BranchRecord::retrieveBranchRecordFromFile(), and BranchRecord::retrieveRecentBranchClusterFromFile().

Here is the caller graph for this function:

◆ saveBranchProcedureControlValueToFile()

void BranchProcedureControlValue::saveBranchProcedureControlValueToFile ( std::ofstream &  )

Writes the label BranchProcedureControlValue, the entry count and every entry to a text restart stream.

Definition at line 85 of file BranchProcedureControlValue.cpp.

References control_value_branches.

Referenced by BranchRecord::saveBranchRecordToFile(), and BranchRecord::saveRecentBranchClusterToFile().

Here is the caller graph for this function:

◆ serialize()

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

Definition at line 66 of file BranchProcedureControlValue.h.

References control_value_branches.

Member Data Documentation

◆ control_value_branches


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