← Documentation
ADS-IDAC Engine 5.0.0
BranchProcedureStep.cpp
Go to the documentation of this file.
1// BranchProcedureStep.cpp: implementation of the BranchProcedureStep class.
2//
4
5#include <sstream>
7#include "../Global/ConvertToString.h"
8#include <boost/serialization/export.hpp>
9#include "../Global/SimulationContext.h"
10#include <boost/archive/binary_oarchive.hpp>
11#include <boost/archive/binary_iarchive.hpp>
12BOOST_CLASS_EXPORT_IMPLEMENT(BranchProcedureStep)
13using namespace std;
14
15
17// Construction/Destruction
19
21}
22
24
25}
27 this->copyDecisionProcedureStep(_psp);
28 this->copyTimerAndProbability(_psp);
29 this->copyCommunication(_psp);
30}
32 string str;
33 str = "Procedure: Sender: ";
34 str += g_sim.Translator.getString(this->getSender());
35 str += "; Receiver: ";
37 str += "; Procedure: ";
38 str += this->getProcedureName();
39 str += "; ";
40 str += this->getStepName();
41 str += "; New Probability: ";
42 std::ostringstream streamObj;
43 streamObj << this->getProbability();
44 str += streamObj.str();
45 return str;
46}
48 string str;
49 str = '"';
50 str += "Procedure:";
51 str += this->getProcedureName();
52 str += ";Step:";
53 str += this->getStepName();
54 str += '"';
55 fout << ' ' << this->getSender() << ' ' << sim::Branch::Procedure << ' ' << sim::None << " procedure " << this->getProbability()
56 << ' '
57 << this->getTimeOfCommunication() << ' ' << this->getRemainingTime() << " 0.0 0 " << str << '\n';
58}
62 this->saveCommunicationToFile(fout);
63}
68}
SimulationContext g_sim
Global simulation context: the single instance, defined in SimulationContext.cpp.
void retrieveBranchProcedureStepFromFile(std::ifstream &)
void copyBranchProcedureStep(BranchProcedureStep &)
void saveBranchProcedureStepToFile(std::ofstream &)
void saveInfoToFile(std::ostream &)
std::string translateMessage()
double getTimeOfCommunication()
void saveCommunicationToFile(std::ofstream &)
int getIntendedReceiver()
void retrieveCommunicationFromFile(std::ifstream &)
void copyCommunication(Communication &)
std::string getString(int) const
void copyDecisionProcedureStep(DecisionProcedureStep &)
void retrieveDecisionProcedureStepFromFile(std::ifstream &)
void saveDecisionProcedureStepToFile(std::ofstream &)
double getProbability()
Definition: Probability.cpp:27
void saveTimerAndProbabilityToFile(std::ofstream &)
void copyTimerAndProbability(TimerAndProbability &)
void retrieveTimerAndProbabilityFromFile(std::ifstream &)
double getRemainingTime()
Definition: Timer.cpp:31
constexpr int Procedure
Definition: SimConstants.h:261
constexpr int None
Definition: SimConstants.h:75
ConvertToString Translator
Parameter name/value conversion.