Skip to main content

RepositionStrategy

Trait RepositionStrategy 

Source
pub trait RepositionStrategy: Send + Sync {
    // Required method
    fn reposition(
        &mut self,
        idle_elevators: &[(EntityId, f64)],
        stop_positions: &[(EntityId, f64)],
        group: &ElevatorGroup,
        world: &World,
    ) -> Vec<(EntityId, EntityId)>;
}
Expand description

Pluggable strategy for repositioning idle elevators.

After the dispatch phase, elevators that remain idle (no pending assignments) are candidates for repositioning. The strategy decides where each idle elevator should move to improve coverage and reduce expected response times.

Implementations receive the set of idle elevator positions and the group’s stop positions, then return a target stop for each elevator (or None to leave it in place).

Required Methods§

Source

fn reposition( &mut self, idle_elevators: &[(EntityId, f64)], stop_positions: &[(EntityId, f64)], group: &ElevatorGroup, world: &World, ) -> Vec<(EntityId, EntityId)>

Decide where to reposition idle elevators.

Returns a vec of (elevator_entity, target_stop_entity) pairs. Elevators not in the returned vec remain idle.

Implementors§