Expand description
Crate containing models for second-by-second fuel and energy consumption of simulation of locomotive consists comprising collections of individual locomotives, which comprise various powertrain components (engine, generator/alternator, battery, and electric drivetrain) – all connected to a detailed train model including drag, grade, curvature, bearing, and rolling resistances.
§Helpful Tips
Every struct in this crate implements methods for serializing/deserializing itself to/from a handful of standard data formats as strings or file read/write operations using traits::SerdeAPI.
§Feature Flags
resources(enabled by default) — Compiles external resources (e.g. vehicle files or cycle files) to be available in the binarypyo3— Exposes ALTRIOS structs, methods, and functions to Python.serde-default(enabled by default) — Enables several text file formats for serialization and deserializationcsv(enabled by default) — Enables csv serialization and deserializationjson(enabled by default) — Enables json serialization and deserializationtoml(enabled by default) — Enables toml serialization and deserializationyaml(enabled by default) — Enables yaml serialization and deserializationmsgpack(enabled by default) — Enables message pack serialization and deserialization viarmp-serdetimer— Activatestimermacros
Modules§
- combo_
error - consist
- Module containing submodules for consists, locomotives, and powertrain models
- error
- Custom error types
- imports
- lin_
search_ hint - macros
- meet_
pass - Meet-pass
- prelude
- 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)
- track
- train
- traits
- uc
- Module providing unit constants (e.g. 1 kg) for an assortment of dimensional quantities.
- utils
- validate
Macros§
- eta_
test_ body - format_
dbg - Generates a String similar to output of
dbgbut without printing - impl_
get_ set_ eta_ max_ min - Implements
get_eta_max,set_eta_max,get_eta_min, andset_eta_minmethods - impl_
get_ set_ eta_ range - init_
opt_ default - Makes it so that optional parameter that is not provided or provided as
Nonegets set in theInit::initcall - make_
uom_ cmp_ fn - print_
to_ py - Given pairs of arbitrary keys and values, prints “key: value” to python intepreter.
Given str, prints str.
Using this will breakcargo testbut work withmaturin develop. - timer
- Times the duration whatever gets passed in