Learn R Programming

SpaDES.core (version 3.2.1)

.restartModuleToReparse: Identify the module whose source should be re-parsed on restart

Description

Picks the module to re-parse(), most-reliable source first: (1) the most-recent recovery snapshot in sim$.recoverableObjs (the interrupted module), (2) sim@current (set while a module event is running), then (3) the first still-queued event's module (optionally restricted to eventType, e.g. ".inputObjects") -- mirroring restartSpades()'s use of events(sim). (3) is the fallback when .recoverableObjs is empty, e.g. a cached earlier .inputObjects swapped sim@.xData and orphaned the recovery accumulator.

Usage

.restartModuleToReparse(
  sim,
  recoverNames = names(sim$.recoverableObjs),
  eventType = NULL
)

Value

A single module name, or NULL if none can be identified.

Arguments

sim

A simList.

recoverNames

Character names of sim$.recoverableObjs (most-recent first).

eventType

Optional event type to which the queued-event fallback is restricted.