pub struct TrainState {Show 33 fields
pub time: TrackedState<Time>,
pub i: TrackedState<usize>,
pub offset: TrackedState<Length>,
pub offset_back: TrackedState<Length>,
pub total_dist: TrackedState<Length>,
pub link_idx_front: TrackedState<u32>,
pub link_idx_back: TrackedState<u32>,
pub offset_in_link: TrackedState<Length>,
pub speed: TrackedState<Velocity>,
pub speed_limit: TrackedState<Velocity>,
pub speed_target: TrackedState<Velocity>,
pub dt: TrackedState<Time>,
pub length: TrackedState<Length>,
pub mass_static: TrackedState<Mass>,
pub mass_rot: TrackedState<Mass>,
pub mass_freight: TrackedState<Mass>,
pub weight_static: TrackedState<Force>,
pub res_rolling: TrackedState<Force>,
pub res_bearing: TrackedState<Force>,
pub res_davis_b: TrackedState<Force>,
pub res_aero: TrackedState<Force>,
pub res_grade: TrackedState<Force>,
pub res_curve: TrackedState<Force>,
pub grade_front: TrackedState<Ratio>,
pub grade_back: TrackedState<Ratio>,
pub elev_front: TrackedState<Length>,
pub elev_back: TrackedState<Length>,
pub pwr_res: TrackedState<Power>,
pub pwr_accel: TrackedState<Power>,
pub pwr_whl_out: TrackedState<Power>,
pub energy_whl_out: TrackedState<Energy>,
pub energy_whl_out_pos: TrackedState<Energy>,
pub energy_whl_out_neg: TrackedState<Energy>,
}Fields§
§time: TrackedState<Time>time since user-defined datum
i: TrackedState<usize>index for time steps
offset: TrackedState<Length>Linear-along-track, directional distance of front of train from original starting position of back of train.
If this is provided in InitTrainState::new, it gets set as the train length or the value, whichever is larger, and if it is not provided, then it defaults to the train length.
offset_back: TrackedState<Length>Linear-along-track, directional distance of back of train from original starting position of back of train.
total_dist: TrackedState<Length>Linear-along-track, cumulative, absolute distance from initial starting position.
link_idx_front: TrackedState<u32>Current link containing head end (i.e. pulling locomotives) of train
link_idx_back: TrackedState<u32>Current link containing tail/back end of train
offset_in_link: TrackedState<Length>Offset from start of current link
speed: TrackedState<Velocity>Achieved speed based on consist capabilities and train resistance
speed_limit: TrackedState<Velocity>Speed limit
speed_target: TrackedState<Velocity>Speed target from meet-pass planner
dt: TrackedState<Time>Time step size
length: TrackedState<Length>Train length
mass_static: TrackedState<Mass>Static mass of train, including freight
mass_rot: TrackedState<Mass>Effective additional mass of train due to rotational inertia
mass_freight: TrackedState<Mass>Mass of freight being hauled by the train (not including railcar empty weight)
weight_static: TrackedState<Force>Static weight of train
res_rolling: TrackedState<Force>Rolling resistance force
res_bearing: TrackedState<Force>Bearing resistance force
res_davis_b: TrackedState<Force>Davis B term resistance force
res_aero: TrackedState<Force>Aerodynamic resistance force
res_grade: TrackedState<Force>Grade resistance force
res_curve: TrackedState<Force>Curvature resistance force
grade_front: TrackedState<Ratio>Grade at front of train
grade_back: TrackedState<Ratio>Grade at back of train of train if strap method is used
elev_front: TrackedState<Length>Elevation at front of train
elev_back: TrackedState<Length>Elevation at back of train
pwr_res: TrackedState<Power>Power to overcome train resistance forces
pwr_accel: TrackedState<Power>Power to overcome inertial forces
pwr_whl_out: TrackedState<Power>Total tractive power exerted by locomotive consist
energy_whl_out: TrackedState<Energy>Integral of Self::pwr_whl_out
energy_whl_out_pos: TrackedState<Energy>Energy out during positive or zero traction
energy_whl_out_neg: TrackedState<Energy>Energy out during negative traction (positive value means negative traction)
Implementations§
Trait Implementations§
Source§impl CheckAndResetState for TrainState
impl CheckAndResetState for TrainState
Source§impl Clone for TrainState
impl Clone for TrainState
Source§fn clone(&self) -> TrainState
fn clone(&self) -> TrainState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TrainState
impl Debug for TrainState
Source§impl Default for TrainState
impl Default for TrainState
Source§impl<'de> Deserialize<'de> for TrainState
impl<'de> Deserialize<'de> for TrainState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Init for TrainState
impl Init for TrainState
Source§impl Mass for TrainState
impl Mass for TrainState
Source§fn mass(&self) -> Result<Option<Mass>>
fn mass(&self) -> Result<Option<Mass>>
Static mass of train, not including effective rotational mass
Source§fn set_mass(
&mut self,
_new_mass: Option<Mass>,
_side_effect: MassSideEffect,
) -> Result<()>
fn set_mass( &mut self, _new_mass: Option<Mass>, _side_effect: MassSideEffect, ) -> Result<()>
mass, or if None is provided for mass,
sets mass based on other component parameters (e.g. power and power
density, sum of fields containing mass)Source§fn derived_mass(&self) -> Result<Option<Mass>>
fn derived_mass(&self) -> Result<Option<Mass>>
Source§fn expunge_mass_fields(&mut self)
fn expunge_mass_fields(&mut self)
None.
Does not touch self.mass.Source§fn set_mass_specific_property(&mut self) -> Result<()>
fn set_mass_specific_property(&mut self) -> Result<()>
Source§impl ObjState for TrainState
impl ObjState for TrainState
Source§impl PartialEq for TrainState
impl PartialEq for TrainState
Source§impl SaveState for TrainState
impl SaveState for TrainState
Source§impl SerdeAPI for TrainState
impl SerdeAPI for TrainState
const ACCEPTED_BYTE_FORMATS: &'static [&'static str] = _
const ACCEPTED_STR_FORMATS: &'static [&'static str] = _
const RESOURCES_SUBDIR: &'static str = ""
const RESOURCES_DIR: &'static Dir<'_> = _
Source§fn from_resource<P: AsRef<Path>>(
filepath: P,
skip_init: bool,
) -> Result<Self, Error>
fn from_resource<P: AsRef<Path>>( filepath: P, skip_init: bool, ) -> Result<Self, Error>
altrios-core crate Read moreSource§fn list_resources() -> Result<Vec<PathBuf>, Error>
fn list_resources() -> Result<Vec<PathBuf>, Error>
Source§fn to_file<P: AsRef<Path>>(&self, filepath: P) -> Result<()>
fn to_file<P: AsRef<Path>>(&self, filepath: P) -> Result<()>
ACCEPTED_BYTE_FORMATS.
Creates a new file if it does not already exist, otherwise truncates the existing file. Read moreSource§fn from_file<P: AsRef<Path>>(
filepath: P,
skip_init: bool,
) -> Result<Self, Error>
fn from_file<P: AsRef<Path>>( filepath: P, skip_init: bool, ) -> Result<Self, Error>
ACCEPTED_BYTE_FORMATS. Read moreSource§fn to_writer<W: Write>(&self, wtr: W, format: &str) -> Result<()>
fn to_writer<W: Write>(&self, wtr: W, format: &str) -> Result<()>
std::io::Write Read moreSource§fn to_str(&self, format: &str) -> Result<String>
fn to_str(&self, format: &str) -> Result<String>
Source§fn from_str<S: AsRef<str>>(
contents: S,
format: &str,
skip_init: bool,
) -> Result<Self>
fn from_str<S: AsRef<str>>( contents: S, format: &str, skip_init: bool, ) -> Result<Self>
Source§fn from_reader<R: Read>(
rdr: &mut R,
format: &str,
skip_init: bool,
) -> Result<Self, Error>
fn from_reader<R: Read>( rdr: &mut R, format: &str, skip_init: bool, ) -> Result<Self, Error>
std::io::Read Read moreSource§fn from_json<S: AsRef<str>>(json_str: S, skip_init: bool) -> Result<Self>
fn from_json<S: AsRef<str>>(json_str: S, skip_init: bool) -> Result<Self>
Source§fn from_msg_pack(msg_pack: &[u8], skip_init: bool) -> Result<Self>
fn from_msg_pack(msg_pack: &[u8], skip_init: bool) -> Result<Self>
Source§impl Serialize for TrainState
impl Serialize for TrainState
Source§impl SetCumulative for TrainState
impl SetCumulative for TrainState
Source§impl Step for TrainState
impl Step for TrainState
impl StateMethods for TrainState
impl StructuralPartialEq for TrainState
Auto Trait Implementations§
impl Freeze for TrainState
impl RefUnwindSafe for TrainState
impl Send for TrainState
impl Sync for TrainState
impl Unpin for TrainState
impl UnwindSafe for TrainState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> EqDefault for T
impl<T> EqDefault for T
Source§fn eq_default(&self) -> bool
fn eq_default(&self) -> bool
Self is equal to Self::defaultSource§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more