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