Constructs a result object from a complete simulation run.
Arguments
- config_fingerprint
Character hash uniquely identifying the configuration
- task_results
List of
bayesim_task_resultobjects- task_grid
Tibble with task grid information (task_id, data_idx, fit_idx, rep_idx, status)
- summary
Tibble with one row per task, columns for metrics and diagnostics
- timing
List containing total, by_phase, and other timing breakdowns
- errors
Tibble of failed tasks with error details
- checkpoint_path
Path to the final checkpoint file, or NULL
Details
The bayesim_simulation_result class encapsulates the complete results of a simulation study, including all individual task results, an aggregated summary, timing breakdowns, error information, and checkpoint location.
Validation rules:
config_fingerprintmust be a scalar charactertask_resultsmust be a list where all elements arebayesim_task_resultsummaryanderrorsmust be data framestiming$totalmust be non-negativecheckpoint_pathmust be NULL or a scalar character
Examples
# Create a simulation result
task1 <- new_task_result(
task_id = "task_001",
status = "success",
metrics = list(rmse = 0.05),
timing = list(total = 5.0)
)
result <- new_simulation_result(
config_fingerprint = "abc123",
task_results = list(task1),
task_grid = tibble::tibble(
task_id = "task_001",
data_idx = 1L,
fit_idx = 1L,
rep_idx = 1L,
status = "success"
),
summary = tibble::tibble(task_id = "task_001", rmse = 0.05),
timing = list(total = 10.0, by_phase = list(setup = 2.0, fit = 8.0)),
errors = tibble::tibble(task_id = character(), error_message = character()),
checkpoint_path = "/path/to/checkpoint.rds"
)