Struct fastsim_core::simdrive::RustSimDriveParams

source ·
pub struct RustSimDriveParams {
Show 31 fields pub favor_grade_accuracy: bool, pub missed_trace_correction: bool, pub max_time_dilation: f64, pub min_time_dilation: f64, pub time_dilation_tol: f64, pub max_trace_miss_iters: u32, pub trace_miss_speed_mps_tol: f64, pub trace_miss_time_tol: f64, pub trace_miss_dist_tol: f64, pub sim_count_max: usize, pub newton_gain: f64, pub newton_max_iter: u32, pub newton_xtol: f64, pub energy_audit_error_tol: f64, pub coast_allow: bool, pub coast_allow_passing: bool, pub coast_max_speed_m_per_s: f64, pub coast_brake_accel_m_per_s2: f64, pub coast_brake_start_speed_m_per_s: f64, pub coast_start_speed_m_per_s: f64, pub coast_time_horizon_for_adjustment_s: f64, pub idm_allow: bool, pub idm_v_desired_m_per_s: f64, pub idm_dt_headway_s: f64, pub idm_minimum_gap_m: f64, pub idm_delta: f64, pub idm_accel_m_per_s2: f64, pub idm_decel_m_per_s2: f64, pub idm_v_desired_in_m_per_s_by_distance_m: Option<Vec<(f64, f64)>>, pub max_epa_adj: f64, pub orphaned: bool,
}
Expand description

Struct containing time trace data

Fields§

§favor_grade_accuracy: bool

if true, accuracy will be favored over performance for grade per step estimates Specifically, for performance, grade for a step will be assumed to be the grade looked up at step start distance. For accuracy, the actual elevations will be used. This distinciton only makes a difference for CAV maneuvers.

§missed_trace_correction: bool

if true, missed trace correction is active, default = False. If missed trace correction is active, time step will be “dilated” to be long enough for vehicle to “catch up” with trace.

§max_time_dilation: f64

maximum time dilation factor to “catch up” with trace – e.g. 1.0 means 100% increase in step size

§min_time_dilation: f64

minimum time dilation margin to let trace “catch up” – e.g. -0.5 means 50% reduction in step size

§time_dilation_tol: f64

convergence criteria for time dilation in iterating on time step size to achieve distance parity

§max_trace_miss_iters: u32

number of iterations to achieve time dilation correction

§trace_miss_speed_mps_tol: f64

threshold for triggering warning log message if vehicle speed deficit [m/s] relative to prescribed speed exceeds this amount

§trace_miss_time_tol: f64

threshold for triggering warning log message if achieved elapsed time relative to prescribed elapsed time exceeds this fractional amount

§trace_miss_dist_tol: f64

threshold for triggering warning log message if achieved distance relative to prescribed distance exceeds this fractional amount

§sim_count_max: usize

max allowable number of HEV SOC iterations

§newton_gain: f64

newton solver gain

§newton_max_iter: u32

newton solver max iterations

§newton_xtol: f64

newton solver tolerance

§energy_audit_error_tol: f64

tolerance for energy audit error warning, i.e. 0.1%

§coast_allow: bool

if true, coasting to stops are allowed

§coast_allow_passing: bool

if true, coasting vehicle can eclipse the shadow trace (i.e., reference vehicle in front)

§coast_max_speed_m_per_s: f64

maximum allowable speed under coast (m/s)

§coast_brake_accel_m_per_s2: f64

acceleration assumed during braking for coast maneuvers (m/s2). note: should be negative

§coast_brake_start_speed_m_per_s: f64

speed when friction braking will initiate during coasting maneuvers (m/s)

§coast_start_speed_m_per_s: f64

initiates coast when vehicle hits this speed if > 0; this is mainly for forceing coasting to initiate for testing. (m/s)

§coast_time_horizon_for_adjustment_s: f64

“look-ahead” time for speed changes to be considered to feature coasting to hit a given stopping distance mark (s)

§idm_allow: bool

if true, initiates the IDM - Intelligent Driver Model, Adaptive Cruise Control version

§idm_v_desired_m_per_s: f64

IDM algorithm: desired speed (m/s)

§idm_dt_headway_s: f64

IDM algorithm: headway time desired to vehicle in front (s)

§idm_minimum_gap_m: f64

IDM algorithm: minimum desired gap between vehicle and lead vehicle (m)

§idm_delta: f64

IDM algorithm: delta parameter

§idm_accel_m_per_s2: f64

IDM algorithm: acceleration parameter

§idm_decel_m_per_s2: f64

IDM algorithm: deceleration parameter

§idm_v_desired_in_m_per_s_by_distance_m: Option<Vec<(f64, f64)>>

IDM algorithm: a way to specify desired speed by course distance traveled. Can simulate changing speed limits over a driving cycle optional list of (distance (m), desired speed (m/s))

§max_epa_adj: f64

EPA fuel economy adjustment parameters; maximum EPA adjustment factor

§orphaned: bool

Trait Implementations§

source§

impl Clone for RustSimDriveParams

source§

fn clone(&self) -> RustSimDriveParams

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RustSimDriveParams

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for RustSimDriveParams

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for RustSimDriveParams

source§

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 PartialEq for RustSimDriveParams

source§

fn eq(&self, other: &RustSimDriveParams) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl SerdeAPI for RustSimDriveParams

source§

const ACCEPTED_BYTE_FORMATS: &'static [&'static str] = _

source§

const ACCEPTED_STR_FORMATS: &'static [&'static str] = _

source§

const RESOURCE_PREFIX: &'static str = ""

source§

const CACHE_FOLDER: &'static str = ""

source§

fn init(&mut self) -> Result<()>

Specialized code to execute upon initialization
source§

fn list_resources() -> Vec<String>

List available (compiled) resources (stored in the rust binary) Read more
source§

fn from_resource<P: AsRef<Path>>(filepath: P, skip_init: bool) -> Result<Self>

Read (deserialize) an object from a resource file packaged with the fastsim-core crate Read more
source§

fn to_file<P: AsRef<Path>>(&self, filepath: P) -> Result<()>

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 more
source§

fn to_writer<W: Write>(&self, wtr: W, format: &str) -> Result<()>

source§

fn from_file<P: AsRef<Path>>(filepath: P, skip_init: bool) -> Result<Self>

Read (deserialize) an object from a file. Supported file extensions are listed in ACCEPTED_BYTE_FORMATS. Read more
source§

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>

Read (deserialize) an object from a string Read more
source§

fn from_reader<R: Read>(rdr: R, format: &str, skip_init: bool) -> Result<Self>

Deserialize an object from anything that implements std::io::Read Read more
source§

fn to_json(&self) -> Result<String>

Write (serialize) an object to a JSON string
source§

fn from_json<S: AsRef<str>>(json_str: S, skip_init: bool) -> Result<Self>

Read (deserialize) an object to a JSON string Read more
source§

fn to_yaml(&self) -> Result<String>

Write (serialize) an object to a YAML string
source§

fn from_yaml<S: AsRef<str>>(yaml_str: S, skip_init: bool) -> Result<Self>

Read (deserialize) an object from a YAML string Read more
source§

fn to_toml(&self) -> Result<String>

source§

fn from_toml<S: AsRef<str>>(toml_str: S, skip_init: bool) -> Result<Self>

source§

fn from_url<S: AsRef<str>>(url: S, skip_init: bool) -> Result<Self>

Instantiates an object from a url. Accepts yaml and json file types Read more
source§

fn to_cache<P: AsRef<Path>>(&self, file_path: P) -> Result<()>

Takes an instantiated Rust object and saves it in the FASTSim data directory in a rust_objects folder.
WARNING: If there is a file already in the data subdirectory with the same name, it will be replaced by the new file. Read more
source§

fn from_cache<P: AsRef<Path>>(file_path: P, skip_init: bool) -> Result<Self>

Instantiates a Rust object from the subdirectory within the FASTSim data directory corresponding to the Rust Object (“vehices” for a RustVehice, “cycles” for a RustCycle, and the root folder of the data directory for all other objects). Read more
source§

impl Serialize for RustSimDriveParams

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for RustSimDriveParams

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
source§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> DeserializeOwnedAlias for T

source§

impl<T> SendAlias for T

source§

impl<T> SendSyncUnwindSafe for T
where T: Send + Sync + UnwindSafe + ?Sized,

source§

impl<T> SerializeAlias for T
where T: Serialize,

source§

impl<T> SyncAlias for T