#[non_exhaustive]pub struct DfcoControls {
pub dfco_enabled: bool,
pub minimum_dfco_speed: Velocity,
pub minimum_dfco_deceleration: Acceleration,
pub stopped_speed_threshold: Velocity,
pub save_interval: Option<usize>,
pub state: DfcoState,
pub history: DfcoStateHistoryVec,
}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.dfco_enabled: boolIf true DFCO is enabled, else it will never run.
minimum_dfco_speed: VelocityThe minimum speed at or above which which DFCO can activate.
minimum_dfco_deceleration: AccelerationThe minimum vehicle acceleration required for DFCO to be able to activate.
stopped_speed_threshold: VelocitySpeed threshold at or below which DFCO is considered unavailable due to near-stop operation.
save_interval: Option<usize>Time step interval between saves. 1 is a good option. If None, no saving occurs.
state: DfcoStatecurrent state of control variables
history: DfcoStateHistoryVechistory of current state
Implementations§
Source§impl DfcoControls
impl DfcoControls
Sourcepub fn is_dfco_disabled_due_to_veh_dynamics(
prev_speed: Velocity,
speed: Velocity,
dt: Time,
dfco_allowed: bool,
minimum_dfco_speed: Velocity,
minimum_dfco_deceleration: Acceleration,
stopped_speed_threshold: Velocity,
) -> bool
pub fn is_dfco_disabled_due_to_veh_dynamics( prev_speed: Velocity, speed: Velocity, dt: Time, dfco_allowed: bool, minimum_dfco_speed: Velocity, minimum_dfco_deceleration: Acceleration, stopped_speed_threshold: Velocity, ) -> bool
Determine if decel fuel cut-off (DFCO) is disabled based on vehicle dynamics considerations (i.e., speed, acceleration). Note: considerations related to whether the engine is too cold and such would be handled elsewhere.
Trait Implementations§
Source§impl Clone for DfcoControls
impl Clone for DfcoControls
Source§fn clone(&self) -> DfcoControls
fn clone(&self) -> DfcoControls
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DfcoControls
impl Debug for DfcoControls
Source§impl Default for DfcoControls
impl Default for DfcoControls
Source§impl<'de> Deserialize<'de> for DfcoControls
impl<'de> Deserialize<'de> for DfcoControls
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 DfcoControls
impl HistoryMethods for DfcoControls
Source§impl Init for DfcoControls
impl Init for DfcoControls
Source§impl PartialEq for DfcoControls
impl PartialEq for DfcoControls
Source§impl SaveState for DfcoControls
impl SaveState for DfcoControls
Source§impl SerdeAPI for DfcoControls
impl SerdeAPI for DfcoControls
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 DfcoControls
impl Serialize for DfcoControls
Source§impl SetCumulative for DfcoControls
impl SetCumulative for DfcoControls
impl StateMethods for DfcoControls
Source§impl Step for DfcoControls
impl Step for DfcoControls
impl StructuralPartialEq for DfcoControls
Source§impl TrackedStateMethods for DfcoControls
impl TrackedStateMethods for DfcoControls
Auto Trait Implementations§
impl Freeze for DfcoControls
impl RefUnwindSafe for DfcoControls
impl Send for DfcoControls
impl Sync for DfcoControls
impl Unpin for DfcoControls
impl UnsafeUnpin for DfcoControls
impl UnwindSafe for DfcoControls
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