Learn R Programming

SpaDES.core (version 3.2.1)

saveSimOnExitSimInit: Save the simList on exit from simInit, mirroring saveSimOnExit()

Description

Like its spades counterpart, this is registered via on.exit inside simInit so it fires whether simInit completes cleanly or is interrupted (e.g., an error in a module's .inputObjects). On a non-clean exit, and when options('spades.recoveryMode') > 0, the accumulated recovery object (rmo) is written into the simList so that restartSimInit() can rewind the state to the start of the interrupted .inputObjects. The clean/interrupted distinction uses a separate flag (.pkgEnv$.cleanEndSimInit) so it does not interfere with the spades event-recovery flag (.pkgEnv$.cleanEnd).

Usage

saveSimOnExitSimInit(recoverMode, sim, rmo)

Arguments