pub struct RustSimDrive {
Show 121 fields pub hev_sim_count: usize, pub veh: RustVehicle, pub cyc: RustCycle, pub cyc0: RustCycle, pub sim_params: RustSimDriveParams, pub props: RustPhysicalProperties, pub i: usize, pub cur_max_fs_kw_out: Array1<f64>, pub fc_trans_lim_kw: Array1<f64>, pub cur_max_fc_kw_out: Array1<f64>, pub ess_cap_lim_dischg_kw: Array1<f64>, pub cur_ess_max_kw_out: Array1<f64>, pub cur_max_avail_elec_kw: Array1<f64>, pub ess_cap_lim_chg_kw: Array1<f64>, pub cur_max_ess_chg_kw: Array1<f64>, pub cur_max_elec_kw: Array1<f64>, pub mc_elec_in_lim_kw: Array1<f64>, pub mc_transi_lim_kw: Array1<f64>, pub cur_max_mc_kw_out: Array1<f64>, pub ess_lim_mc_regen_perc_kw: Array1<f64>, pub cur_max_mech_mc_kw_in: Array1<f64>, pub cur_max_trans_kw_out: Array1<f64>, pub cyc_trac_kw_req: Array1<f64>, pub cur_max_trac_kw: Array1<f64>, pub spare_trac_kw: Array1<f64>, pub cyc_whl_rad_per_sec: Array1<f64>, pub cyc_tire_inertia_kw: Array1<f64>, pub cyc_whl_kw_req: Array1<f64>, pub regen_contrl_lim_kw_perc: Array1<f64>, pub cyc_regen_brake_kw: Array1<f64>, pub cyc_fric_brake_kw: Array1<f64>, pub cyc_trans_kw_out_req: Array1<f64>, pub cyc_met: Array1<bool>, pub trans_kw_out_ach: Array1<f64>, pub trans_kw_in_ach: Array1<f64>, pub cur_soc_target: Array1<f64>, pub min_mc_kw_2help_fc: Array1<f64>, pub mc_mech_kw_out_ach: Array1<f64>, pub mc_elec_kw_in_ach: Array1<f64>, pub aux_in_kw: Array1<f64>, pub impose_coast: Array1<bool>, pub roadway_chg_kw_out_ach: Array1<f64>, pub min_ess_kw_2help_fc: Array1<f64>, pub ess_kw_out_ach: Array1<f64>, pub fc_kw_out_ach: Array1<f64>, pub fc_kw_out_ach_pct: Array1<f64>, pub fc_kw_in_ach: Array1<f64>, pub fs_kw_out_ach: Array1<f64>, pub fs_kwh_out_ach: Array1<f64>, pub ess_cur_kwh: Array1<f64>, pub soc: Array1<f64>, pub regen_buff_soc: Array1<f64>, pub ess_regen_buff_dischg_kw: Array1<f64>, pub max_ess_regen_buff_chg_kw: Array1<f64>, pub ess_accel_buff_chg_kw: Array1<f64>, pub accel_buff_soc: Array1<f64>, pub max_ess_accell_buff_dischg_kw: Array1<f64>, pub ess_accel_regen_dischg_kw: Array1<f64>, pub mc_elec_in_kw_for_max_fc_eff: Array1<f64>, pub elec_kw_req_4ae: Array1<f64>, pub can_pwr_all_elec: Array1<bool>, pub desired_ess_kw_out_for_ae: Array1<f64>, pub ess_ae_kw_out: Array1<f64>, pub er_ae_kw_out: Array1<f64>, pub ess_desired_kw_4fc_eff: Array1<f64>, pub ess_kw_if_fc_req: Array1<f64>, pub cur_max_mc_elec_kw_in: Array1<f64>, pub fc_kw_gap_fr_eff: Array1<f64>, pub er_kw_if_fc_req: Array1<f64>, pub mc_elec_kw_in_if_fc_req: Array1<f64>, pub mc_kw_if_fc_req: Array1<f64>, pub fc_forced_on: Array1<bool>, pub fc_forced_state: Array1<u32>, pub mc_mech_kw_4forced_fc: Array1<f64>, pub fc_time_on: Array1<f64>, pub prev_fc_time_on: Array1<f64>, pub mps_ach: Array1<f64>, pub mph_ach: Array1<f64>, pub dist_m: Array1<f64>, pub dist_mi: Array1<f64>, pub high_acc_fc_on_tag: Array1<bool>, pub reached_buff: Array1<bool>, pub max_trac_mps: Array1<f64>, pub add_kwh: Array1<f64>, pub dod_cycs: Array1<f64>, pub ess_perc_dead: Array1<f64>, pub drag_kw: Array1<f64>, pub ess_loss_kw: Array1<f64>, pub accel_kw: Array1<f64>, pub ascent_kw: Array1<f64>, pub rr_kw: Array1<f64>, pub cur_max_roadway_chg_kw: Array1<f64>, pub trace_miss_iters: Array1<u32>, pub newton_iters: Array1<u32>, pub fuel_kj: f64, pub ess_dischg_kj: f64, pub energy_audit_error: f64, pub mpgge: f64, pub roadway_chg_kj: f64, pub battery_kwh_per_mi: f64, pub electric_kwh_per_mi: f64, pub ess2fuel_kwh: f64, pub drag_kj: f64, pub ascent_kj: f64, pub rr_kj: f64, pub brake_kj: f64, pub trans_kj: f64, pub mc_kj: f64, pub ess_eff_kj: f64, pub aux_kj: f64, pub fc_kj: f64, pub net_kj: f64, pub ke_kj: f64, pub trace_miss: bool, pub trace_miss_dist_frac: f64, pub trace_miss_time_frac: f64, pub trace_miss_speed_mps: f64, pub orphaned: bool, pub coast_delay_index: Array1<i32>, pub idm_target_speed_m_per_s: Array1<f64>, pub cyc0_cache: RustCycleCache, /* private fields */
}

Fields§

§hev_sim_count: usize§veh: RustVehicle§cyc: RustCycle§cyc0: RustCycle§sim_params: RustSimDriveParams§props: RustPhysicalProperties§i: usize§cur_max_fs_kw_out: Array1<f64>

Current maximum fuel storage output power, considering veh.fs_max_kw and transient limit, as determined by achieved fuel storage power output and veh.fs_secs_to_peak_pwr

§fc_trans_lim_kw: Array1<f64>

Transient fuel converter output power limit, as determined by achieved fuel converter power output, veh.fc_max_kw, and veh.fs_secs_to_peak_pwr

§cur_max_fc_kw_out: Array1<f64>

Current maximum fuel converter output power, considering veh.fc_max_kw and transient limit fc_trans_lim_kw

§ess_cap_lim_dischg_kw: Array1<f64>

ESS discharging power limit, considering remaining ESS energy and ESS efficiency

§cur_ess_max_kw_out: Array1<f64>

Current maximum ESS output power, considering ess_cap_lim_dischg_kw and veh.ess_max_kw

§cur_max_avail_elec_kw: Array1<f64>

Current maximum electrical power that can go toward propulsion, cur_max_elec_kw limited by the maximum theoretical motor input power veh.mc_max_elec_in_kw

§ess_cap_lim_chg_kw: Array1<f64>

ESS charging power limit, considering unused energy capacity and ESS efficiency

§cur_max_ess_chg_kw: Array1<f64>

ESS charging power limit, considering ess_cap_lim_chg_kw and veh.ess_max_kw

§cur_max_elec_kw: Array1<f64>

Current maximum electrical power that can go toward propulsion: if FCEV, equal to cur_max_fc_kw_out + cur_max_roadway_chg_kw + cur_ess_max_kw_out - aux_in_kw, otherwise equal to cur_max_roadway_chg_kw + cur_ess_max_kw_out - aux_in_kw

§mc_elec_in_lim_kw: Array1<f64>§mc_transi_lim_kw: Array1<f64>

Transient electric motor output power limit, as determined by achieved motor mechanical power output, veh.mc_max_kw, and veh.ms_secs_to_peak_pwr

§cur_max_mc_kw_out: Array1<f64>§ess_lim_mc_regen_perc_kw: Array1<f64>§cur_max_mech_mc_kw_in: Array1<f64>

ESS limit on electricity regeneration, considering veh.mc_max_kw, or cur_max_ess_chg_kw and motor efficiency

§cur_max_trans_kw_out: Array1<f64>§cyc_trac_kw_req: Array1<f64>

Required tractive power to meet cycle, equal to drag_kw + accel_kw + ascent_kw

§cur_max_trac_kw: Array1<f64>§spare_trac_kw: Array1<f64>§cyc_whl_rad_per_sec: Array1<f64>§cyc_tire_inertia_kw: Array1<f64>

Power to change wheel rotational speed, calculated with veh.wheel_inertia_kg_m2 and veh.num_wheels

§cyc_whl_kw_req: Array1<f64>

Required power to wheels to meet cycle, equal to cyc_trac_kw_req + rr_kw + cyc_tire_inertia_kw

§regen_contrl_lim_kw_perc: Array1<f64>§cyc_regen_brake_kw: Array1<f64>§cyc_fric_brake_kw: Array1<f64>

Power lost to friction braking, only nonzero when cyc_whl_kw_req is negative and regenerative braking cannot provide enough braking,

§cyc_trans_kw_out_req: Array1<f64>

Required transmission output power to meet cycle, equal to cyc_whl_kw_req + cyc_fric_brake_kw

§cyc_met: Array1<bool>

true if cyc_trans_kw_out_req <= cur_max_trans_kw_out

§trans_kw_out_ach: Array1<f64>

Achieved transmission output power, either cyc_trans_kw_out_req if cycle is met, or cur_max_trans_kw_out if it is not

§trans_kw_in_ach: Array1<f64>

Achieved transmission input power, accounting for veh.trans_eff

§cur_soc_target: Array1<f64>§min_mc_kw_2help_fc: Array1<f64>§mc_mech_kw_out_ach: Array1<f64>

Achieved electric motor mechanical output power to transmission

§mc_elec_kw_in_ach: Array1<f64>

Achieved electric motor electrical input power, accounting for electric motor efficiency

§aux_in_kw: Array1<f64>

Auxiliary power load, optionally overridden with an input array, or if aux loads are forced to go through alternator (when veh.no_elec_aux is true) equal to veh.aux_kw / veh.alt_eff otherwise equal to veh.aux_kw

§impose_coast: Array1<bool>§roadway_chg_kw_out_ach: Array1<f64>§min_ess_kw_2help_fc: Array1<f64>§ess_kw_out_ach: Array1<f64>§fc_kw_out_ach: Array1<f64>§fc_kw_out_ach_pct: Array1<f64>§fc_kw_in_ach: Array1<f64>§fs_kw_out_ach: Array1<f64>§fs_kwh_out_ach: Array1<f64>§ess_cur_kwh: Array1<f64>§soc: Array1<f64>

Current ESS state of charge, multiply by veh.ess_max_kwh to calculate remaining ESS energy

§regen_buff_soc: Array1<f64>§ess_regen_buff_dischg_kw: Array1<f64>§max_ess_regen_buff_chg_kw: Array1<f64>§ess_accel_buff_chg_kw: Array1<f64>§accel_buff_soc: Array1<f64>§max_ess_accell_buff_dischg_kw: Array1<f64>§ess_accel_regen_dischg_kw: Array1<f64>§mc_elec_in_kw_for_max_fc_eff: Array1<f64>§elec_kw_req_4ae: Array1<f64>

Electrical power requirement for all-electric operation, only applicable if vehicle has electrified powertrain, equal to aux_in_kw + trans_kw_in_ach / motor efficiency

§can_pwr_all_elec: Array1<bool>§desired_ess_kw_out_for_ae: Array1<f64>§ess_ae_kw_out: Array1<f64>§er_ae_kw_out: Array1<f64>

Charging power received from electric roadway (er), if enabled, for all electric (ae) operation.

§ess_desired_kw_4fc_eff: Array1<f64>§ess_kw_if_fc_req: Array1<f64>§cur_max_mc_elec_kw_in: Array1<f64>§fc_kw_gap_fr_eff: Array1<f64>§er_kw_if_fc_req: Array1<f64>§mc_elec_kw_in_if_fc_req: Array1<f64>§mc_kw_if_fc_req: Array1<f64>§fc_forced_on: Array1<bool>§fc_forced_state: Array1<u32>§mc_mech_kw_4forced_fc: Array1<f64>

Power the motor (mc) must provide if the engine (fc) is being forced on. If the engine just turned on and triggers a regen event, it’ll be negative.

§fc_time_on: Array1<f64>§prev_fc_time_on: Array1<f64>§mps_ach: Array1<f64>§mph_ach: Array1<f64>§dist_m: Array1<f64>§dist_mi: Array1<f64>§high_acc_fc_on_tag: Array1<bool>§reached_buff: Array1<bool>§max_trac_mps: Array1<f64>§add_kwh: Array1<f64>§dod_cycs: Array1<f64>§ess_perc_dead: Array1<f64>§drag_kw: Array1<f64>

Power lost to aerodynamic drag according to the drag equation, 1/2 * rho * Cd * A * v_avg³ / 1000

§ess_loss_kw: Array1<f64>§accel_kw: Array1<f64>

Power to accelerate, veh.veh_kg * (v_current² - v_prev²)/2 / dt / 1000

§ascent_kw: Array1<f64>

Power expended to ascend a grade, sin(atan(grade)) * props.a_grav_mps2 * veh.veh_kg * v_avg / 1000

§rr_kw: Array1<f64>

Power lost to rolling resistance, normal force * veh.wheel_rr_coef * v_avg / 1000, with normal force calculated as cos(atan(grade)) * veh.veh_kg * props.a_grav_mps2

§cur_max_roadway_chg_kw: Array1<f64>§trace_miss_iters: Array1<u32>§newton_iters: Array1<u32>§fuel_kj: f64§ess_dischg_kj: f64§energy_audit_error: f64§mpgge: f64§roadway_chg_kj: f64§battery_kwh_per_mi: f64§electric_kwh_per_mi: f64§ess2fuel_kwh: f64§drag_kj: f64§ascent_kj: f64§rr_kj: f64§brake_kj: f64§trans_kj: f64§mc_kj: f64§ess_eff_kj: f64§aux_kj: f64§fc_kj: f64§net_kj: f64§ke_kj: f64§trace_miss: bool§trace_miss_dist_frac: f64§trace_miss_time_frac: f64§trace_miss_speed_mps: f64§orphaned: bool§coast_delay_index: Array1<i32>§idm_target_speed_m_per_s: Array1<f64>§cyc0_cache: RustCycleCache

Implementations§

source§

impl RustSimDrive

source

pub fn gap_to_lead_vehicle_m(&self) -> Array1<f64>

Provides the gap-with lead vehicle from start to finish

source

pub fn activate_eco_cruise_rust( &mut self, by_microtrip: bool, extend_fraction: f64, blend_factor: f64, min_target_speed_m_per_s: f64 ) -> Result<()>

Sets the intelligent driver model parameters for an eco-cruise driving trajectory. This is a convenience method instead of setting the sim_params.idm* parameters yourself.

  • by_microtrip: bool, if True, target speed is set by microtrip, else by cycle
  • extend_fraction: float, the fraction of time to extend the cycle to allow for catch-up of the following vehicle
  • blend_factor: float, a value between 0 and 1; only used of by_microtrip is True, blends between microtrip average speed and microtrip average speed when moving. Must be between 0 and 1 inclusive
  • min_target_speed_m_per_s: float, the minimum speed allowed by the eco-cruise algorithm Mutates the current SimDrive object for eco-cruise.
source

pub fn next_speed_by_idm( &mut self, i: usize, a_m_per_s2: f64, b_m_per_s2: f64, dt_headway_s: f64, s0_m: f64, v_desired_m_per_s: f64, delta: f64 ) -> f64

Calculate the next speed by the Intelligent Driver Model

  • i: int, the index
  • a_m_per_s2: number, max acceleration (m/s2)
  • b_m_per_s2: number, max deceleration (m/s2)
  • dt_headway_s: number, the headway between us and the lead vehicle in seconds
  • s0_m: number, the initial gap between us and the lead vehicle in meters
  • v_desired_m_per_s: number, the desired speed in (m/s)
  • delta: number, a shape parameter; typical value is 4.0 RETURN: number, the next speed (m/s) REFERENCE: Treiber, Martin and Kesting, Arne. 2013. “Chapter 11: Car-Following Models Based on Driving Strategies”. Traffic Flow Dynamics: Data, Models and Simulation. Springer-Verlag. Springer, Berlin, Heidelberg. DOI: https://doi.org/10.1007/978-3-642-32460-4.
source

pub fn set_speed_for_target_gap_using_idm(&mut self, i: usize)

Set gap

  • i: non-negative integer, the step index RETURN: None EFFECTS:
  • sets the next speed (m/s) EQUATION: parameters:
    • v_desired: the desired speed (m/s)
    • delta: number, typical value is 4.0
    • a: max acceleration, (m/s2)
    • b: max deceleration, (m/s2) s = d_lead - d dv/dt = a * (1 - (v/v_desired)**delta - (s_desired(v,v-v_lead)/s)**2) s_desired(v, dv) = s0 + max(0, vdt_headway + (v * dv)/(2.0 * sqrt(ab))) REFERENCE: Treiber, Martin and Kesting, Arne. 2013. “Chapter 11: Car-Following Models Based on Driving Strategies”. Traffic Flow Dynamics: Data, Models and Simulation. Springer-Verlag. Springer, Berlin, Heidelberg. DOI: https://doi.org/10.1007/978-3-642-32460-4
source

pub fn set_speed_for_target_gap(&mut self, i: usize)

  • i: non-negative integer, the step index RETURN: None EFFECTS:
  • sets the next speed (m/s)
source

pub fn estimate_grade_for_step(&self, i: usize) -> f64

Provides a quick estimate for grade based only on the distance traveled at the start of the current step. If the grade is constant over the step, this is both quick and accurate. NOTE: If not allowing coasting (i.e., sim_params.coast_allow == False) and not allowing IDM/following (i.e., self.sim_params.idm_allow == False) then returns self.cyc.grade[i]

source

pub fn lookup_grade_for_step(&self, i: usize, mps_ach: Option<f64>) -> f64

For situations where cyc can deviate from cyc0, this method looks up and accurately interpolates what the average grade over the step should be. If mps_ach is not None, the mps_ach value is used to predict the distance traveled over the step. NOTE: If not allowing coasting (i.e., sim_params.coast_allow == False) and not allowing IDM/following (i.e., self.sim_params.idm_allow == False) then returns self.cyc.grade[i]

source

pub fn set_time_dilation(&mut self, i: usize) -> Result<()>

source

pub fn set_coast_speed(&mut self, i: usize) -> Result<()>

Placeholder for method to impose coasting. Might be good to include logic for deciding when to coast. Solve for the next-step speed that will yield a zero roadload

source§

impl RustSimDrive

source

pub fn new(cyc: RustCycle, veh: RustVehicle) -> Self

source

pub fn len(&self) -> usize

Return length of time arrays

source

pub fn is_empty(&self) -> bool

Is cycle empty?

source

pub fn init_arrays(&mut self)

source

pub fn sim_drive( &mut self, init_soc: Option<f64>, aux_in_kw_override: Option<Array1<f64>> ) -> Result<()>

§Initialize and run sim_drive_walk as appropriate for vehicle attribute vehPtType. Arguments

init_soc: initial SOC for electrified vehicles.
aux_in_kw: aux_in_kw override. Array of same length as cyc.time_s.
Default of None causes veh.aux_kw to be used.

source

pub fn sim_drive_accel( &mut self, init_soc: Option<f64>, aux_in_kw_override: Option<Array1<f64>> ) -> Result<()>

source

pub fn walk( &mut self, init_soc: f64, aux_in_kw_override: Option<Array1<f64>> ) -> Result<()>

Receives second-by-second cycle information, vehicle properties, and an initial state of charge and runs sim_drive_step to perform a backward facing powertrain simulation. Method sim_drive runs this iteratively to achieve correct SOC initial and final conditions, as needed.

§Arguments

init_soc: initial battery state-of-charge (SOC) for electrified vehicles aux_in_kw: (Optional) aux_in_kw override. Array of same length as cyc.time_s. None causes veh.aux_kw to be used.

source

pub fn init_for_step( &mut self, init_soc: f64, aux_in_kw_override: Option<Array1<f64>> ) -> Result<()>

§This is a specialty method which should be called prior to using sim_drive_step in a loop. Arguments

init_soc: initial battery state-of-charge (SOC) for electrified vehicles aux_in_kw: aux_in_kw override. Array of same length as cyc.time_s.
Default of None causes veh.aux_kw to be used.

source

pub fn step(&mut self) -> Result<()>

Step through 1 time step.

source

pub fn solve_step(&mut self, i: usize) -> Result<()>

Perform all the calculations to solve 1 time step.

source

pub fn set_misc_calcs(&mut self, i: usize) -> Result<()>

§Sets misc. calculations at time step ‘i’ Arguments:

i: index of time step

source

pub fn set_comp_lims(&mut self, i: usize) -> Result<()>

§Sets component limits for time step ‘i’ Arguments

i: index of time step initSoc: initial SOC for electrified vehicles

source

pub fn set_power_calcs(&mut self, i: usize) -> Result<()>

§Calculate power requirements to meet cycle and determine if cycle can be met. Arguments

i: index of time step

source

pub fn set_ach_speed(&mut self, i: usize) -> Result<()>

source

pub fn set_hybrid_cont_calcs(&mut self, i: usize) -> Result<()>

§Hybrid control calculations. Arguments

i: index of time step

source

pub fn set_fc_forced_state_rust(&mut self, i: usize) -> Result<()>

i: index of time step

source

pub fn set_hybrid_cont_decisions(&mut self, i: usize) -> Result<()>

§Hybrid control decisions. Arguments

i: index of time step

source

pub fn set_fc_power(&mut self, i: usize) -> Result<()>

§Sets power consumption values for the current time step. Arguments

i: index of time step

source

pub fn set_post_scalars(&mut self) -> Result<()>

Sets scalar variables that can be calculated after a cycle is run. This includes mpgge, various energy metrics, and others

Trait Implementations§

source§

impl Clone for RustSimDrive

source§

fn clone(&self) -> RustSimDrive

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 RustSimDrive

source§

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

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

impl<'de> Deserialize<'de> for RustSimDrive

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 RustSimDrive

source§

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

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

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

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

impl SerdeAPI for RustSimDrive

source§

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

Specialized code to execute upon initialization
source§

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

source§

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

source§

const CACHE_FOLDER: &'static str = _

source§

fn from_resource<P: AsRef<Path>>(filepath: P) -> 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) -> 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) -> Result<Self>

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

fn from_reader<R: Read>(rdr: R, format: &str) -> 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) -> 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) -> Result<Self>

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

fn to_bincode(&self) -> Result<Vec<u8>>

Write (serialize) an object to bincode-encoded bytes
source§

fn from_bincode(encoded: &[u8]) -> Result<Self>

Read (deserialize) an object from bincode-encoded bytes Read more
source§

fn from_url<S: AsRef<str>>(url: S) -> 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) -> 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 RustSimDrive

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 RustSimDrive

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> 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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>,

§

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

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

§

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

§

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