6#include <boost/serialization/export.hpp>
13#include "../Scheduler/Scheduler.h"
16#include "../Global/SimulationContext.h"
17#include "../Global/CheckedIO.h"
18#include <boost/archive/binary_oarchive.hpp>
19#include <boost/archive/binary_iarchive.hpp>
23namespace fs = std::filesystem;
52 string full_file_name;
53 int num_subfolder, size_of_subfolder;
58 full_file_name +=
"ESFolder_";
61 full_file_name += to_string(num_subfolder);
62 fs::create_directories(full_file_name);
63 full_file_name +=
"//ZESNode_";
66 full_file_name +=
"ZESNode_";
70 full_file_name +=
".txt";
72 ofstream fout(full_file_name.c_str(), ios::out);
105 fin.open(strFileName.c_str(), ios::in);
109 >> num >> num >> num >> num
116 while (ch !=
'"' && !fin.eof()){
122 }
while(ch !=
'"' && !fin.eof());
Central dynamic event tree data structure: the branch clusters, the end states and the forks that are...
bool checked_close(std::ofstream &ofs, const std::string &path)
Flush and close an output stream and report a failed write.
SimulationContext g_sim
Global simulation context: the single instance, defined in SimulationContext.cpp.
The end state (ES node) that terminates one sequence of the DET.
virtual ~BranchEndState()
std::string consequence_description
void saveInfoToFile()
Writes this end state as an ES node file, overwriting any existing file.
void setIDOfThisEndState(int)
Sets the end state ID. It is also the sequence ID used in the ZESNode file name.
Consequence type_of_consequence
void copyBranchEndState(BranchEndState &)
Copies every field, including the Time and Probability parts.
Consequence getTypeOfConsequence()
void setTypeOfConsequence(Consequence)
int getIDOfTheMotherBranch()
void saveBranchEndStateToFile(std::ofstream &)
Writes the end state to a text restart stream as <consequence as int> <id> <mother branch id> <descri...
int ID_of_the_mother_branch
void setConsequenceDescription(std::string)
void setIDOfTheMotherBranch(int)
Sets the ID of the branch (PE node) this end state hangs from.
void retrieveBranchEndStateFromFile(std::ifstream &)
Reads the layout written by saveBranchEndStateToFile. The description is read with >>,...
std::string getConsequenceDescription()
BranchEndState()
Constructs an end state with consequence Consequence::NoKB, both IDs sim::None and the description "N...
int getIDOfThisEndState()
void copyProbability(Probability &)
void setProbability(double)
void saveProbabilityToFile(std::ofstream &)
void retrieveProbabilityFromFile(std::ifstream &)
std::string getESDirectory()
void setFileNameES(std::string)
double getTimeAtWhichThisEventHappen() const
void saveTimeToFile(std::ofstream &)
void setTimeAtWhichThisEventHappen(double)
void retrieveTimeFromFile(std::ifstream &)
Scheduler SScheduler
Simulation scheduling, parses CLI options.
BranchRecord Branch_center
Dynamic event tree state.