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(Result &)> | ProfilingBuildHook Hook to configure a separate, throw-away simulation used for profiling. |
| 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 "1.0.0". |
| 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 & | onProfilingBuild(ProfilingBuildHook hook) |
| 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 ProfilingBuildHook
using chronon::SimulationApp::ProfilingBuildHook = std::function<void(Result&)>;
Hook to configure a separate, throw-away simulation used for profiling.
When parallel + weighted partitioning are enabled, profiling builds a temporary simulation, configures it via this hook, profiles, and destroys it before the real simulation is built — this prevents profiling from contaminating real state. Configure with independent resources that can be safely destroyed.
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 "1.0.0".
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 onProfilingBuild
SimulationApp & onProfilingBuild(
ProfilingBuildHook hook
)
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-05-26 at 05:42:32 +0000