pub struct EnergyProfile {
pub idle_cost_per_tick: f64,
pub move_cost_per_tick: f64,
pub weight_factor: f64,
pub regen_factor: f64,
}Expand description
Per-elevator energy cost parameters.
Attach to an elevator entity via World::set_energy_profile
to enable energy tracking for that car. The energy system automatically
initializes EnergyMetrics if not already present.
Fields§
§idle_cost_per_tick: f64Energy consumed per tick while idle (doors closed, stationary).
move_cost_per_tick: f64Base energy consumed per tick while moving.
weight_factor: f64Multiplier applied to current load weight when moving.
regen_factor: f64Fraction of consumed energy regenerated when descending (0.0 - 1.0).
Implementations§
Source§impl EnergyProfile
impl EnergyProfile
Sourcepub const fn new(
idle_cost_per_tick: f64,
move_cost_per_tick: f64,
weight_factor: f64,
regen_factor: f64,
) -> Self
pub const fn new( idle_cost_per_tick: f64, move_cost_per_tick: f64, weight_factor: f64, regen_factor: f64, ) -> Self
Create a new energy profile with the given parameters.
Sourcepub const fn idle_cost_per_tick(&self) -> f64
pub const fn idle_cost_per_tick(&self) -> f64
Energy consumed per tick while idle.
Sourcepub const fn move_cost_per_tick(&self) -> f64
pub const fn move_cost_per_tick(&self) -> f64
Base energy consumed per tick while moving.
Sourcepub const fn weight_factor(&self) -> f64
pub const fn weight_factor(&self) -> f64
Multiplier applied to current load weight when moving.
Sourcepub const fn regen_factor(&self) -> f64
pub const fn regen_factor(&self) -> f64
Fraction of consumed energy regenerated when descending.
Trait Implementations§
Source§impl Clone for EnergyProfile
impl Clone for EnergyProfile
Source§fn clone(&self) -> EnergyProfile
fn clone(&self) -> EnergyProfile
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 EnergyProfile
impl Debug for EnergyProfile
Source§impl<'de> Deserialize<'de> for EnergyProfile
impl<'de> Deserialize<'de> for EnergyProfile
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
Auto Trait Implementations§
impl Freeze for EnergyProfile
impl RefUnwindSafe for EnergyProfile
impl Send for EnergyProfile
impl Sync for EnergyProfile
impl Unpin for EnergyProfile
impl UnsafeUnpin for EnergyProfile
impl UnwindSafe for EnergyProfile
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