pub struct SpreadEvenly;Expand description
Distribute idle elevators evenly across the group’s stops.
For each idle elevator, assigns it to the stop position that maximizes the minimum distance from any other (non-idle or already-assigned) elevator. This spreads coverage across the shaft.
Trait Implementations§
Source§impl RepositionStrategy for SpreadEvenly
impl RepositionStrategy for SpreadEvenly
Source§fn reposition(
&mut self,
idle_elevators: &[(EntityId, f64)],
stop_positions: &[(EntityId, f64)],
group: &ElevatorGroup,
world: &World,
out: &mut Vec<(EntityId, EntityId)>,
)
fn reposition( &mut self, idle_elevators: &[(EntityId, f64)], stop_positions: &[(EntityId, f64)], group: &ElevatorGroup, world: &World, out: &mut Vec<(EntityId, EntityId)>, )
Decide where to reposition idle elevators. Read more
Source§fn builtin_id(&self) -> Option<BuiltinReposition>
fn builtin_id(&self) -> Option<BuiltinReposition>
If this strategy is a known built-in variant, return it so
Simulation::set_reposition
callers don’t have to pass a separate BuiltinReposition id
that might drift from the dispatcher’s actual type. Read moreSource§fn min_arrival_log_window(&self) -> u64
fn min_arrival_log_window(&self) -> u64
Minimum
ArrivalLog retention
(in ticks) the strategy needs to function. Strategies that read
the log directly with a custom rolling window must override this
so Simulation::set_reposition
can widen
ArrivalLogRetention
to keep the data alive long enough for the query. Read moreAuto Trait Implementations§
impl Freeze for SpreadEvenly
impl RefUnwindSafe for SpreadEvenly
impl Send for SpreadEvenly
impl Sync for SpreadEvenly
impl Unpin for SpreadEvenly
impl UnsafeUnpin for SpreadEvenly
impl UnwindSafe for SpreadEvenly
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