Stride Reference Manual
- generated for commit 9643b11
|
Controls a simulation run initiated with the command line interface (cli). More...
#include <ControlHelper.h>
Public Member Functions | |
ControlHelper (const boost::property_tree::ptree &config, std::string name) | |
Straight initialization. More... | |
~ControlHelper () | |
Simple destructor. More... | |
Protected Member Functions | |
ControlHelper () | |
Empty controller: used as target for delegation. More... | |
void | CheckEnv () |
Check install environment. More... | |
void | CheckOutputPrefix () |
void | InstallLogger () |
Make the appropriate logger for cli environment and register as stride_logger. More... | |
void | LogStartup () |
Logs info on setup for cli environment to stride_logger. More... | |
void | RegisterViewers (std::shared_ptr< SimRunner > runner) |
Register the viewers of the SimRunner. More... | |
void | Shutdown () |
Logs info on setup for cli environment to stride_logger. More... | |
Protected Attributes | |
boost::property_tree::ptree | m_config |
Main configuration for run and sim. More... | |
std::string | m_name |
Contoller's name. More... | |
std::string | m_output_prefix |
Prefix to output (name prefix or prefix dir) More... | |
util::Stopwatch | m_run_clock |
Stopwatch for timing the computation. More... | |
std::shared_ptr< spdlog::logger > | m_stride_logger |
General logger. More... | |
bool | m_use_install_dirs |
Working dir or install dir mode. More... | |
Controls a simulation run initiated with the command line interface (cli).
ControlHelper functions effected on behalf of the controllers include:
Definition at line 45 of file ControlHelper.h.
|
explicit |
Straight initialization.
stride::ControlHelper::~ControlHelper | ( | ) |
Simple destructor.
Definition at line 50 of file ControlHelper.cpp.
References ControlHelper(), m_config, m_name, m_output_prefix, m_run_clock, m_use_install_dirs, Shutdown(), and stride::util::Stopwatch< T >::Start().
|
explicitprotected |
Empty controller: used as target for delegation.
Definition at line 44 of file ControlHelper.cpp.
Referenced by ~ControlHelper().
|
protected |
Check install environment.
Definition at line 64 of file ControlHelper.cpp.
References stride::util::FileSys::CheckInstallEnv(), and m_use_install_dirs.
Referenced by stride::GenPopController::Control(), stride::SimController::Control(), and stride::StanController::Control().
|
protected |
Definition at line 74 of file ControlHelper.cpp.
References stride::util::FileSys::CreateDirectory(), stride::util::FileSys::IsDirectoryString(), and m_output_prefix.
Referenced by stride::GenPopController::Control(), stride::SimController::Control(), and stride::StanController::Control().
|
protected |
Make the appropriate logger for cli environment and register as stride_logger.
Definition at line 81 of file ControlHelper.cpp.
References stride::util::FileSys::BuildPath(), stride::util::LogUtils::CreateCliLogger(), stride::util::LogUtils::CreateFileLogger(), m_config, m_name, m_output_prefix, and m_stride_logger.
Referenced by stride::GenPopController::Control(), stride::SimController::Control(), and stride::StanController::Control().
|
protected |
Logs info on setup for cli environment to stride_logger.
Definition at line 110 of file ControlHelper.cpp.
References stride::util::FileSys::GetConfigDir(), stride::util::FileSys::GetCurrentDir(), stride::util::FileSys::GetDataDir(), stride::util::FileSys::GetExecPath(), stride::util::FileSys::GetRootDir(), stride::util::ConfigInfo::GitRevision(), stride::util::ConfigInfo::HaveOpenMP(), m_config, m_name, m_output_prefix, m_stride_logger, m_use_install_dirs, stride::util::ConfigInfo::NumberAvailableThreads(), stride::util::ConfigInfo::ProcessorCount(), and stride::ContactLogMode::ToString().
Referenced by stride::GenPopController::Control(), stride::SimController::Control(), and stride::StanController::Control().
|
protected |
Register the viewers of the SimRunner.
Definition at line 139 of file ControlHelper.cpp.
References m_config, m_output_prefix, m_stride_logger, stride::viewers::SummaryFileViewer::Update(), stride::viewers::CliViewer::Update(), stride::viewers::PersonsFileViewer::Update(), and stride::viewers::InfectedFileViewer::Update().
Referenced by stride::SimController::Control().
|
protected |
Logs info on setup for cli environment to stride_logger.
Definition at line 102 of file ControlHelper.cpp.
References m_name, m_run_clock, m_stride_logger, stride::util::Stopwatch< T >::Stop(), and stride::util::Stopwatch< T >::ToString().
Referenced by ~ControlHelper().
|
protected |
Main configuration for run and sim.
Definition at line 78 of file ControlHelper.h.
Referenced by stride::GenPopController::Control(), stride::SimController::Control(), stride::StanController::Control(), InstallLogger(), LogStartup(), RegisterViewers(), and ~ControlHelper().
|
protected |
Contoller's name.
Definition at line 79 of file ControlHelper.h.
Referenced by InstallLogger(), LogStartup(), Shutdown(), and ~ControlHelper().
|
protected |
Prefix to output (name prefix or prefix dir)
Definition at line 80 of file ControlHelper.h.
Referenced by CheckOutputPrefix(), InstallLogger(), LogStartup(), RegisterViewers(), and ~ControlHelper().
|
protected |
Stopwatch for timing the computation.
Definition at line 81 of file ControlHelper.h.
Referenced by Shutdown(), and ~ControlHelper().
|
protected |
General logger.
Definition at line 82 of file ControlHelper.h.
Referenced by stride::GenPopController::Control(), stride::SimController::Control(), stride::StanController::Control(), InstallLogger(), LogStartup(), RegisterViewers(), and Shutdown().
|
protected |
Working dir or install dir mode.
Definition at line 83 of file ControlHelper.h.
Referenced by CheckEnv(), LogStartup(), and ~ControlHelper().