Module sim::utils[][src]

Expand description

The utilies module provides general capabilities, that may span the input modeling, models, output analysis, and simulator modules. The utilities are centered around debugging/traceability and common arithmetic.

Modules

error

Functions

default_records_port_name

Provides a centralized default name for records ports

evaluate_polynomial

The function evaluates a polynomial at a single value, with coefficients defined as a slice, from the highest polynomial order to the zero order. Horner’s method is used for this polynomial evaluation

populate_history_port

Populate a history metrics port specification with either a None (if the history metrics are not required) or the default Some(“history”) (if history metrics are required)

populate_snapshot_port

Populate a snapshot metrics port specification with either a None (if the snapshot metrics are not required) or the default Some(“snapshot”) (if snapshot metrics are required)

set_panic_hook

When the console_error_panic_hook feature is enabled, we can call the set_panic_hook function at least once during initialization, and then we will get better error messages if our code ever panics.

usize_sqrt

Integer square root calculation, using the Babylonian square-root algorithm.