Create a Pulse engine and execute the scenario opts. More...

#include <PulseScenarioExec.h>

Inherits SEScenarioExec.

Public Member Functions

 PulseScenarioExec (Logger *logger)
 
void Clear () override
 
void Copy (const PulseScenarioExec &src)
 
eModelType GetModelType () const
 
void SetModelType (eModelType mt)
 
bool SerializeToString (std::string &output, eSerializationFormat m, Logger *logger=nullptr) const
 
bool SerializeFromString (const std::string &src, eSerializationFormat m, Logger *logger=nullptr)
 
bool Execute ()
 
- Public Member Functions inherited from SEScenarioExec
 SEScenarioExec (Logger *logger)
 
virtual ~SEScenarioExec ()
 
virtual void Clear ()
 
void Copy (const SEScenarioExec &src)
 
eSwitch LogToConsole () const
 
void LogToConsole (eSwitch s)
 
virtual eRelativeSerialization GetRelativeSerialization () const
 
virtual void SetRelativeSerialization (eRelativeSerialization rt)
 
std::string GetDataRootDirectory () const
 
void SetDataRootDirectory (const std::string &fn)
 
std::string GetOutputRootDirectory () const
 
void SetOutputRootDirectory (const std::string &d)
 
eSwitch OrganizeOutputDirectory () const
 
void OrganizeOutputDirectory (eSwitch s)
 
std::string GetScenarioContent () const
 
void SetScenarioContent (const std::string &sc)
 
std::string GetScenarioFilename () const
 
void SetScenarioFilename (const std::string &fn)
 
std::string GetScenarioDirectory () const
 
void SetScenarioDirectory (const std::string &dir)
 
std::string GetScenarioExecListFilename () const
 
void SetScenarioExecListFilename (const std::string &fn)
 
std::string GetScenarioLogFilename () const
 
void SetScenarioLogFilename (const std::string &fn)
 
std::string GetScenarioLogDirectory () const
 
void SetScenarioLogDirectory (const std::string &dir)
 
std::set< std::string > & GetDataRequestFilesSearch ()
 
const std::set< std::string > & GetDataRequestFilesSearch () const
 
eSerializationFormat GetContentFormat () const
 
void SetContentFormat (eSerializationFormat s)
 
int GetThreadCount () const
 
void SetThreadCount (int c)
 
std::string GetEngineConfigurationContent () const
 
void SetEngineConfigurationContent (const std::string &ecc)
 
std::string GetEngineConfigurationFilename () const
 
void SetEngineConfigurationFilename (const std::string &fn)
 
eSwitch AutoSerializeAfterActions () const
 
void AutoSerializeAfterActions (eSwitch s)
 
double GetAutoSerializePeriod_s () const
 
void SetAutoSerializePeriod_s (double s)
 
eSwitch TimeStampSerializedStates () const
 
void TimeStampSerializedStates (eSwitch s)
 
bool SerializeToString (std::string &output, eSerializationFormat m) const
 
bool SerializeFromString (const std::string &src, eSerializationFormat m)
 
- Public Member Functions inherited from Loggable
 Loggable (Logger *logger=nullptr)
 
 Loggable (std::string const &logfile)
 
virtual ~Loggable ()
 
virtual LoggerGetLogger () const
 
virtual void SetLogger (Logger &logger)
 
virtual void Debug (std::string const &msg) const
 
virtual void Debug (std::stringstream &msg) const
 
virtual void Debug (std::ostream &msg) const
 
virtual void Info (std::string const &msg) const
 
virtual void Info (std::stringstream &msg) const
 
virtual void Info (const std::stringstream &msg) const
 
virtual void Info (std::ostream &msg) const
 
virtual void Warning (std::string const &msg) const
 
virtual void Warning (std::stringstream &msg) const
 
virtual void Warning (std::ostream &msg) const
 
virtual void Error (std::string const &msg) const
 
virtual void Error (std::stringstream &msg) const
 
virtual void Error (std::ostream &msg) const
 
virtual void Fatal (std::string const &msg) const
 
virtual void Fatal (std::stringstream &msg) const
 
virtual void Fatal (std::ostream &msg) const
 

Protected Member Functions

size_t ComputeNumThreads ()
 
bool Execute (PulseScenario &sce, SEScenarioExecStatus *status=nullptr)
 
bool ConvertLog ()
 
- Protected Member Functions inherited from SEScenarioExec
bool ConvertLog ()
 
bool Execute (PhysiologyEngine &pe, SEScenario &sce, SEScenarioExecStatus *status=nullptr)
 
bool Process (PhysiologyEngine &pe, SEScenario &sce, SEScenarioExecStatus *status=nullptr)
 
bool ProcessActions (PhysiologyEngine &pe, SEScenario &sce, SEScenarioExecStatus *status=nullptr)
 
bool ProcessAction (PhysiologyEngine &pe, SEAction &action)
 
void AdvanceEngine (PhysiologyEngine &pe)
 

Static Protected Member Functions

static void ControllerLoop (const std::string copy, std::mutex *m, std::vector< SEScenarioExecStatus > *s, size_t *completed, const std::string fn, Logger *logger)
 

Protected Attributes

std::vector< std::thread > m_Threads
 
std::mutex m_Mutex
 
std::vector< SEScenarioExecStatusm_Statuses
 
size_t m_Completed
 
eModelType m_ModelType = eModelType::HumanAdultWholeBody
 
- Protected Attributes inherited from SEScenarioExec
eSwitch m_LogToConsole
 
std::string m_DataRootDirectory
 
std::string m_OutputRootDirectory
 
eSwitch m_OrganizeOutputDirectory
 
std::string m_BaseFilename
 
std::string m_LogFilename
 
std::string m_DataRequestCSVFilename
 
std::string m_EngineConfigurationContent
 
std::string m_EngineConfigurationFilename
 
std::string m_ScenarioContent
 
std::string m_ScenarioFilename
 
std::string m_ScenarioDirectory
 
std::string m_ScenarioExecListFilename
 
std::string m_ScenarioLogFilename
 
std::string m_ScenarioLogDirectory
 
std::set< std::string > m_DataRequestFilesSearch
 
eSerializationFormat m_ContentFormat
 
int m_ThreadCount
 
bool m_SaveNextStep
 
eRelativeSerialization m_RelativeSerialization
 
std::string m_AutoSerializeFilename
 
std::string m_AutoSerializeBaseFilename
 
std::string m_AutoSerializeFilenameExt
 
eSwitch m_AutoSerializeAfterActions
 
double m_AutoSerializePeriod_s
 
double m_AutoSerializeTime_s
 
eSwitch m_TimeStampSerializedStates
 
eSwitch m_ReloadSerializedState
 
std::stringstream m_SerializationOutput
 
std::stringstream m_SerializationActions
 
- Protected Attributes inherited from Loggable
bool myLogger
 
Loggerm_Logger
 

Detailed Description

Create a Pulse engine and execute the scenario opts.

Constructor & Destructor Documentation

◆ PulseScenarioExec()

PulseScenarioExec::PulseScenarioExec ( Logger logger)
inline

Member Function Documentation

◆ Clear()

void PulseScenarioExec::Clear ( )
overridevirtual

Reimplemented from SEScenarioExec.

◆ ComputeNumThreads()

size_t PulseScenarioExec::ComputeNumThreads ( )
protected

◆ ControllerLoop()

void PulseScenarioExec::ControllerLoop ( const std::string  copy,
std::mutex *  m,
std::vector< SEScenarioExecStatus > *  s,
size_t *  completed,
const std::string  fn,
Logger logger 
)
staticprotected

◆ ConvertLog()

bool PulseScenarioExec::ConvertLog ( )
protected

◆ Copy()

void PulseScenarioExec::Copy ( const PulseScenarioExec src)

◆ Execute() [1/2]

bool PulseScenarioExec::Execute ( )

◆ Execute() [2/2]

bool PulseScenarioExec::Execute ( PulseScenario sce,
SEScenarioExecStatus status = nullptr 
)
protected

◆ GetModelType()

eModelType PulseScenarioExec::GetModelType ( ) const
inline

◆ SerializeFromString()

bool PulseScenarioExec::SerializeFromString ( const std::string &  src,
eSerializationFormat  m,
Logger logger = nullptr 
)

◆ SerializeToString()

bool PulseScenarioExec::SerializeToString ( std::string &  output,
eSerializationFormat  m,
Logger logger = nullptr 
) const

◆ SetModelType()

void PulseScenarioExec::SetModelType ( eModelType  mt)
inline

Member Data Documentation

◆ m_Completed

size_t PulseScenarioExec::m_Completed
protected

◆ m_ModelType

eModelType PulseScenarioExec::m_ModelType = eModelType::HumanAdultWholeBody
protected

◆ m_Mutex

std::mutex PulseScenarioExec::m_Mutex
protected

◆ m_Statuses

std::vector<SEScenarioExecStatus> PulseScenarioExec::m_Statuses
protected

◆ m_Threads

std::vector<std::thread> PulseScenarioExec::m_Threads
protected

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.