pub trait RepositionStrategy: Send + Sync {
// Required method
fn reposition(
&mut self,
idle_elevators: &[(EntityId, f64)],
stop_positions: &[(EntityId, f64)],
group: &ElevatorGroup,
world: &World,
out: &mut 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§
Sourcefn 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.
Push (elevator_entity, target_stop_entity) pairs into out.
The buffer is cleared before each call — implementations should
only push, never read prior contents. Elevators not pushed remain idle.