pub struct Checkpoint {Show 15 fields
pub deck_hash: u64,
pub unknowns: Vec<String>,
pub t: f64,
pub accepted_steps: usize,
pub step_index: usize,
pub dt_next: Option<f64>,
pub ringing_cooldown: u32,
pub x_prev: Vec<f64>,
pub x_prev_prev: Option<Vec<f64>>,
pub point_prev: PointSnapshot,
pub prev_diode_raw_ioff: BTreeMap<String, f64>,
pub prev_segments: Option<Vec<u8>>,
pub prev_gate_states: Option<BTreeMap<String, bool>>,
pub prev_outputs: BTreeMap<String, SignalSnapshot>,
pub blocks: Vec<(String, BlockSnapshot)>,
}Expand description
The complete loop-carried state of a transient run at the end of an accepted step.
Fields§
§deck_hash: u64Identifies the deck this was taken from — see deck_hash. A load into a deck with a
different hash is refused as DaeError::CheckpointDeckMismatch.
unknowns: Vec<String>The system’s unknown names, in x order — reported in the mismatch error so the reader
can see what differs, and double-checked on load.
t: f64§accepted_steps: usizeAccepted steps so far (the adaptive stall guard counts from here).
step_index: usizeThe loop’s own step index — nonzero on resume, so the first resumed step is not treated as a run’s first step (which would force backward Euler).
dt_next: Option<f64>The adaptive controller’s suggested next step; None for a fixed-step run.
ringing_cooldown: u32§x_prev: Vec<f64>§x_prev_prev: Option<Vec<f64>>§point_prev: PointSnapshot§prev_diode_raw_ioff: BTreeMap<String, f64>§prev_segments: Option<Vec<u8>>Each diode’s previous segment, as classify_segments numbers them (0 breakdown, 1
leakage, 2 forward); None before the first accepted step.
prev_gate_states: Option<BTreeMap<String, bool>>Each ideal switch’s previous gate state, true for on.
prev_outputs: BTreeMap<String, SignalSnapshot>§blocks: Vec<(String, BlockSnapshot)>One entry per block, in the caller’s block order, keyed by name for the mismatch check.
Implementations§
Source§impl Checkpoint
impl Checkpoint
Sourcepub fn to_bytes(&self) -> Result<Vec<u8>, DaeError>
pub fn to_bytes(&self) -> Result<Vec<u8>, DaeError>
The file encoding: MAGIC, FORMAT_VERSION, then the postcard payload.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, DaeError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, DaeError>
The inverse of Self::to_bytes; a wrong magic or an unknown version is reported as
such rather than decoded into garbage.