#[non_exhaustive]pub struct ConventionalVehicle {
pub fs: FuelStorage,
pub fc: FuelConverter,
pub transmission: Transmission,
pub alt_eff: Ratio,
/* private fields */
}Expand description
Conventional vehicle with only a FuelConverter as a power source
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.fs: FuelStorage§fc: FuelConverter§transmission: Transmission§alt_eff: RatioAlternator efficiency used to calculate aux mechanical power demand on engine
Implementations§
Source§impl ConventionalVehicle
impl ConventionalVehicle
pub fn solve_thermal( &mut self, te_amb: Temperature, pwr_thrml_fc_to_cab: Option<Power>, veh_state: &mut VehicleState, dt: Time, ) -> Result<()>
Trait Implementations§
Source§impl Clone for ConventionalVehicle
impl Clone for ConventionalVehicle
Source§fn clone(&self) -> ConventionalVehicle
fn clone(&self) -> ConventionalVehicle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConventionalVehicle
impl Debug for ConventionalVehicle
Source§impl<'de> Deserialize<'de> for ConventionalVehicle
impl<'de> Deserialize<'de> for ConventionalVehicle
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl HistoryMethods for ConventionalVehicle
impl HistoryMethods for ConventionalVehicle
Source§impl Init for ConventionalVehicle
impl Init for ConventionalVehicle
Source§impl Mass for ConventionalVehicle
impl Mass for ConventionalVehicle
Source§fn mass(&self) -> Result<Option<Mass>>
fn mass(&self) -> Result<Option<Mass>>
Returns mass of Self, either from
self.mass or
the derived from fields that store mass data. Mass::mass also checks that
derived mass, if Some, is same as self.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<()>
Sets component mass to
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>>
Returns derived mass (e.g. sum of mass fields, or
calculation involving mass specific properties). If
Source§fn expunge_mass_fields(&mut self)
fn expunge_mass_fields(&mut self)
Sets all fields that are used in calculating derived mass to
None.
Does not touch self.mass.Source§fn set_mass_specific_property(&mut self) -> Result<()>
fn set_mass_specific_property(&mut self) -> Result<()>
Sets any mass-specific property with appropriate side effects
Source§impl PartialEq for ConventionalVehicle
impl PartialEq for ConventionalVehicle
Source§impl Powertrain for Box<ConventionalVehicle>
impl Powertrain for Box<ConventionalVehicle>
Source§fn set_curr_pwr_prop_out_max(
&mut self,
_pwr_upstream: (Power, Power),
pwr_aux: Power,
dt: Time,
_veh_state: &VehicleState,
) -> Result<()>
fn set_curr_pwr_prop_out_max( &mut self, _pwr_upstream: (Power, Power), pwr_aux: Power, dt: Time, _veh_state: &VehicleState, ) -> Result<()>
Sets maximum possible positive and negative propulsion-related powers
this component/system can produce, accounting for any aux-related power
required. Read more
Source§fn get_curr_pwr_prop_out_max(&self) -> Result<(Power, Power)>
fn get_curr_pwr_prop_out_max(&self) -> Result<(Power, Power)>
Returns maximum achievable positive and negative propulsion powers after
Powertrain::set_curr_pwr_prop_out_max has been called.
Source§impl SaveState for ConventionalVehicle
impl SaveState for ConventionalVehicle
Source§impl SerdeAPI for ConventionalVehicle
impl SerdeAPI for ConventionalVehicle
const ACCEPTED_BYTE_FORMATS: &'static [&'static str] = _
const ACCEPTED_STR_FORMATS: &'static [&'static str] = _
const RESOURCES_DIR: &'static Dir<'_> = _
const RESOURCES_SUBDIR: &'static str = ""
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>
Read (deserialize) an object from a resource file packaged with the
fastsim-core crate Read moreSource§fn list_resources() -> Result<Vec<PathBuf>, Error>
fn list_resources() -> Result<Vec<PathBuf>, Error>
List the available resources in the resources directory Read more
Source§fn to_file<P: AsRef<Path>>(&self, filepath: P) -> Result<(), Error>
fn to_file<P: AsRef<Path>>(&self, filepath: P) -> Result<(), Error>
Write (serialize) an object to a file.
Supported file extensions are listed in
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>
Read (deserialize) an object from a file.
Supported file extensions are listed in
ACCEPTED_BYTE_FORMATS. Read moreSource§fn to_writer<W: Write>(&self, wtr: W, format: &str) -> Result<(), Error>
fn to_writer<W: Write>(&self, wtr: W, format: &str) -> Result<(), Error>
Write (serialize) an object into anything that implements
std::io::Write Read moreSource§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>
Deserialize an object from anything that implements
std::io::Read Read moreSource§fn to_str(&self, format: &str) -> Result<String>
fn to_str(&self, format: &str) -> Result<String>
Write (serialize) an object into a string Read more
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>
Read (deserialize) an object from a string Read more
Source§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>
Read (deserialize) an object from a JSON string Read more
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>
Read (deserialize) an object from a message pack Read more
Source§impl Serialize for ConventionalVehicle
impl Serialize for ConventionalVehicle
Source§impl SetCumulative for ConventionalVehicle
impl SetCumulative for ConventionalVehicle
Source§impl Step for ConventionalVehicle
impl Step for ConventionalVehicle
Source§impl TryFrom<&RustVehicle> for ConventionalVehicle
impl TryFrom<&RustVehicle> for ConventionalVehicle
Source§fn try_from(f2veh: &RustVehicle) -> Result<ConventionalVehicle>
fn try_from(f2veh: &RustVehicle) -> Result<ConventionalVehicle>
Performs the conversion.
Source§impl TryFrom<PowertrainType> for Box<ConventionalVehicle>
impl TryFrom<PowertrainType> for Box<ConventionalVehicle>
Source§type Error = TryIntoError<PowertrainType>
type Error = TryIntoError<PowertrainType>
The type returned in the event of a conversion error.
impl StateMethods for ConventionalVehicle
impl StructuralPartialEq for ConventionalVehicle
Auto Trait Implementations§
impl Freeze for ConventionalVehicle
impl RefUnwindSafe for ConventionalVehicle
impl Send for ConventionalVehicle
impl Sync for ConventionalVehicle
impl Unpin for ConventionalVehicle
impl UnwindSafe for ConventionalVehicle
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§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>
Converts
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>
Converts
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