SEScenarioExec.h
32 virtual eRelativeSerialization GetRelativeSerialization() const { return m_RelativeSerialization; }
33 virtual void SetRelativeSerialization(eRelativeSerialization rt) { m_RelativeSerialization = rt; }
108 const std::set<std::string>& GetDataRequestFilesSearch() const { return m_DataRequestFilesSearch; }
114 // if > 0, we will create min of (that many threads) or (number of cores available on the host system)
138 // If they do not, then we are not maintaining state properly to the file and back into the engine
139 // To find serialization issues, uncomment out the AutoSerialization line in the ScenarioVerification.config
140 // Then run the `run ScenarioVerification` command to run all scenarios, have then save out and in after each action
141 // This test will also compare the resulting CSV file to the baseline CSV that did not save in and out
144 // 1. Run one run where we save out states after we apply an action and after the subsequent time step
145 // 2. Run another run where we save out the same times, but we reload the state after the first save
146 // This gives us two states at the same point in time, per action, that we can compare to see what is different
165 bool ProcessActions(PhysiologyEngine& pe, SEScenario& sce, SEScenarioExecStatus* status=nullptr);
233 bool SerializeToString(std::string& output, eSerializationFormat m, Logger* logger) const override;
234 bool SerializeFromString(const std::string& src, eSerializationFormat m, Logger* logger) override;
235 static bool SerializeToFile(const std::vector<SEScenarioExecStatus>& src, const std::string& filename, Logger* logger);
236 static bool SerializeFromFile(const std::string& filename, std::vector<SEScenarioExecStatus>& dst, Logger* logger);
Definition: Logger.h:23
Definition: Logger.h:71
Definition: PBScenario.h:10
static bool SerializeFromFile(const std::string &filename, SEScenario &dst)
Definition: PBScenario.cpp:102
static bool SerializeToFile(const SEScenario &src, const std::string &filename)
Definition: PBScenario.cpp:88
static bool SerializeFromString(const std::string &src, SEScenario &dst, eSerializationFormat m)
Definition: PBScenario.cpp:94
static void Copy(const SEScenario &src, SEScenario &dst)
Definition: PBScenario.cpp:74
static bool SerializeToString(const SEScenario &src, std::string &output, eSerializationFormat m)
Definition: PBScenario.cpp:82
Definition: PhysiologyEngine.h:68
Definition: SEAction.h:14
Definition: SEEngineConfiguration.h:8
Definition: SEEngineInitialization.h:70
Definition: SEScenarioExec.h:20
void SetScenarioDirectory(const std::string &dir)
Definition: SEScenarioExec.h:65
void AutoSerializeAfterActions(eSwitch s)
Definition: SEScenarioExec.h:150
double m_AutoSerializePeriod_s
Definition: SEScenarioExec.h:208
double GetAutoSerializePeriod_s() const
Definition: SEScenarioExec.h:152
std::string GetScenarioLogFilename() const
Definition: SEScenarioExec.h:86
std::string m_AutoSerializeBaseFilename
Definition: SEScenarioExec.h:205
void SetScenarioLogDirectory(const std::string &dir)
Definition: SEScenarioExec.h:97
eSwitch m_OrganizeOutputDirectory
Definition: SEScenarioExec.h:175
std::string m_EngineConfigurationFilename
Definition: SEScenarioExec.h:185
void SetEngineConfigurationFilename(const std::string &fn)
Definition: SEScenarioExec.h:126
std::set< std::string > & GetDataRequestFilesSearch()
Definition: SEScenarioExec.h:107
eSerializationFormat GetContentFormat() const
Definition: SEScenarioExec.h:110
void SetScenarioFilename(const std::string &fn)
Definition: SEScenarioExec.h:55
std::string GetDataRootDirectory() const
Definition: SEScenarioExec.h:35
std::string GetScenarioExecListFilename() const
Definition: SEScenarioExec.h:75
void SetContentFormat(eSerializationFormat s)
Definition: SEScenarioExec.h:111
std::string m_EngineConfigurationContent
Definition: SEScenarioExec.h:184
std::string m_AutoSerializeFilenameExt
Definition: SEScenarioExec.h:206
std::stringstream m_SerializationOutput
Definition: SEScenarioExec.h:212
std::string GetEngineConfigurationContent() const
Definition: SEScenarioExec.h:119
eRelativeSerialization m_RelativeSerialization
Definition: SEScenarioExec.h:203
std::string GetScenarioDirectory() const
Definition: SEScenarioExec.h:64
eSwitch TimeStampSerializedStates() const
Definition: SEScenarioExec.h:155
eSwitch OrganizeOutputDirectory() const
Definition: SEScenarioExec.h:41
void TimeStampSerializedStates(eSwitch s)
Definition: SEScenarioExec.h:156
std::string m_DataRequestCSVFilename
Definition: SEScenarioExec.h:180
eSwitch m_ReloadSerializedState
Definition: SEScenarioExec.h:211
std::string GetScenarioLogDirectory() const
Definition: SEScenarioExec.h:96
std::string m_AutoSerializeFilename
Definition: SEScenarioExec.h:204
eSwitch m_AutoSerializeAfterActions
Definition: SEScenarioExec.h:207
std::string GetScenarioContent() const
Definition: SEScenarioExec.h:44
std::string m_ScenarioLogDirectory
Definition: SEScenarioExec.h:193
void SetScenarioExecListFilename(const std::string &fn)
Definition: SEScenarioExec.h:76
const std::set< std::string > & GetDataRequestFilesSearch() const
Definition: SEScenarioExec.h:108
std::string GetScenarioFilename() const
Definition: SEScenarioExec.h:54
std::string m_ScenarioExecListFilename
Definition: SEScenarioExec.h:190
eSwitch m_TimeStampSerializedStates
Definition: SEScenarioExec.h:210
void SetScenarioContent(const std::string &sc)
Definition: SEScenarioExec.h:45
void SetScenarioLogFilename(const std::string &fn)
Definition: SEScenarioExec.h:87
std::set< std::string > m_DataRequestFilesSearch
Definition: SEScenarioExec.h:195
void SetEngineConfigurationContent(const std::string &ecc)
Definition: SEScenarioExec.h:120
std::string GetOutputRootDirectory() const
Definition: SEScenarioExec.h:38
std::string GetEngineConfigurationFilename() const
Definition: SEScenarioExec.h:125
void OrganizeOutputDirectory(eSwitch s)
Definition: SEScenarioExec.h:42
virtual eRelativeSerialization GetRelativeSerialization() const
Definition: SEScenarioExec.h:32
eSwitch AutoSerializeAfterActions() const
Definition: SEScenarioExec.h:149
void SetAutoSerializePeriod_s(double s)
Definition: SEScenarioExec.h:153
virtual void SetRelativeSerialization(eRelativeSerialization rt)
Definition: SEScenarioExec.h:33
void SetDataRootDirectory(const std::string &fn)
Definition: SEScenarioExec.h:36
std::string m_OutputRootDirectory
Definition: SEScenarioExec.h:174
std::stringstream m_SerializationActions
Definition: SEScenarioExec.h:213
std::string m_ScenarioLogFilename
Definition: SEScenarioExec.h:192
Definition: SEScenarioExec.h:220
double GetFinalSimulationTime_s() const
Definition: SEScenarioExec.h:251
void ForwardError(std::string const &) override
Definition: SEScenarioExec.h:226
std::string m_ScenarioFilename
Definition: SEScenarioExec.h:255
eScenarioExecutionState m_ScenarioExecutionState
Definition: SEScenarioExec.h:256
void SetScenarioFilename(const std::string &fn)
Definition: SEScenarioExec.h:240
std::string GetScenarioFilename() const
Definition: SEScenarioExec.h:239
double m_FinalSimulationTime_s
Definition: SEScenarioExec.h:259
void ForwardFatal(std::string const &) override
Definition: SEScenarioExec.h:227
bool HasFatalRuntimeError() const
Definition: SEScenarioExec.h:248
bool HasScenarioFilename() const
Definition: SEScenarioExec.h:238
eScenarioExecutionState GetScenarioExecutionState() const
Definition: SEScenarioExec.h:242
void SetFinalSimulationTime_s(double t)
Definition: SEScenarioExec.h:252
void SetScenarioExecutionState(eScenarioExecutionState s)
Definition: SEScenarioExec.h:243
void SetFatalRuntimeError(bool e)
Definition: SEScenarioExec.h:249
Definition: SEScenario.h:12
Definition: SEScenarioLog.h:14