chronon::SimulationApp
Unified entry point: CLI, YAML override handling, and observation lifecycle. More...
#include <SimulationApp.hpp>
Public Classes
| Name | |
|---|---|
| struct | Result Simulation outcome: builder output plus runtime stats and termination state. |
Public Types
| Name | |
|---|---|
| using std::function< void(YAML::Node &)> | PreBuildHook Hook to mutate YAML before parsing — useful for programmatic config changes. |
| using std::function< void(Result &)> | PostRunHook Hook for post-processing after the run completes. |
| using std::function< void(Result &)> | PostBuildHook Hook called with the built simulation; lets clients touch created units. |
Public Functions
| Name | |
|---|---|
| SimulationApp & | setVersion(std::string version) Shown with –version. Default "0.3.2". |
| SimulationApp & | setDefaultThreads(uint32_t n) 0 = inherit YAML or system default. |
| SimulationApp & | setDefaultCycles(uint64_t n) 0 = run until completion. |
| SimulationApp & | setDefaultConfig(std::string path) Path may be absolute or relative to the configured search paths. |
| SimulationApp & | setConfigSearchPaths(std::vector< std::string > paths) Default search paths are {"."}. |
| int | run(int argc, char * argv[]) Main entry: parse args, load YAML, build, run, report. Returns process exit code. |
| SimulationApp & | onPreBuild(PreBuildHook hook) |
| SimulationApp & | onPostRun(PostRunHook hook) |
| SimulationApp & | onPostBuild(PostBuildHook hook) |
SimulationApp(std::string name, std::string description ="")name appears in help and banner. |
Detailed Description
class chronon::SimulationApp;
Unified entry point: CLI, YAML override handling, and observation lifecycle.
Standard CLI: [config.yaml], -c/--config, -p/--param KEY=VALUE, -o/--output-dir, -n/--run-cycles, -t/--threads, --epoch-size, --no-observe, -v/--verbose, -h/--help, --version.
Public Types Documentation
using PreBuildHook
using chronon::SimulationApp::PreBuildHook = std::function<void(YAML::Node&)>;
Hook to mutate YAML before parsing — useful for programmatic config changes.
using PostRunHook
using chronon::SimulationApp::PostRunHook = std::function<void(Result&)>;
Hook for post-processing after the run completes.
using PostBuildHook
using chronon::SimulationApp::PostBuildHook = std::function<void(Result&)>;
Hook called with the built simulation; lets clients touch created units.
Public Functions Documentation
function setVersion
SimulationApp & setVersion(
std::string version
)
Shown with –version. Default "0.3.2".
function setDefaultThreads
SimulationApp & setDefaultThreads(
uint32_t n
)
0 = inherit YAML or system default.
function setDefaultCycles
SimulationApp & setDefaultCycles(
uint64_t n
)
0 = run until completion.
function setDefaultConfig
SimulationApp & setDefaultConfig(
std::string path
)
Path may be absolute or relative to the configured search paths.
function setConfigSearchPaths
SimulationApp & setConfigSearchPaths(
std::vector< std::string > paths
)
Default search paths are {"."}.
function run
int run(
int argc,
char * argv[]
)
Main entry: parse args, load YAML, build, run, report. Returns process exit code.
function onPreBuild
SimulationApp & onPreBuild(
PreBuildHook hook
)
function onPostRun
SimulationApp & onPostRun(
PostRunHook hook
)
function onPostBuild
SimulationApp & onPostBuild(
PostBuildHook hook
)
function SimulationApp
explicit SimulationApp(
std::string name,
std::string description =""
)
name appears in help and banner.
Updated on 2026-07-06 at 09:03:34 +0000