Crate fastsim_core

Source
Expand description

Core crate for performing FASTSim simulations.

§Crate Specific Coding Practices

  • #[non_exhaustive] macro is invoked to force any downstream crate to use the Init trait to initialize structs that implement this macro
  • #[fastsim_api] – used to expose the struct to python and provides assorted other features related to usability Crate containing models for second-by-second fuel and energy consumption of simulation of vehicles

§Feature Flags

  • pyo3 — Enables pyo3 to provide fastsim-3 structs, methods, and functions to Python
  • resources (enabled by default) — Compiles external resources (e.g. vehicle files or cycle files) to be available in the binary
  • web — Enables internet-querying dependencies
  • serde-default (enabled by default) — Enables several text file formats for serialization and deserialization
  • csv (enabled by default) — Enables csv serialization and deserialization
  • json (enabled by default) — Enables json serialization and deserialization
  • toml (enabled by default) — Enables toml serialization and deserialization
  • yaml (enabled by default) — Enables yaml serialization and deserialization
  • msgpack (enabled by default) — Enables message pack serialization and deserialization via rmp-serde

Modules§

drive_cycle
error
Custom error types
gas_properties
imports
Module for crate-local imports to reduce boilerplate in submodules
macros
prelude
Convenience module for exposing commonly used structs
resources
si
Import uom si system and add unit constants Zero values should be created using standard uom syntax ($Quantity::ZERO) after adding “use crate::imports::*” Non-zero values should be created using standard uom syntax ($Quantity::new::<$unit>($value)) or multiplication syntax ($value * $UNIT_CONSTANT)
simdrive
traits
uc
Module providing unit constants (e.g. 1 kg) for an assortment of dimensional quantities.
utils
vehicle
Module containing submodules for vehicle and powertrain models

Macros§

eff_test_body
format_dbg
Generates a String similar to output of dbg but without printing
init_opt_default
Makes it so that optional parameters get set in the Init::init call
make_uom_cmp_fn

Functions§

enabled_features
List enabled features