#[non_exhaustive]pub enum BuiltinStrategy {
Scan,
Look,
NearestCar,
Etd,
Destination,
Rsr,
LoopSweep,
LoopSchedule,
Custom(String),
}Expand description
Serializable identifier for built-in dispatch strategies.
Used in snapshots and config files to restore the correct strategy
without requiring the game to manually re-wire dispatch. Custom strategies
are represented by the Custom(String) variant.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Scan
SCAN (elevator) algorithm — sweeps end-to-end.
Look
LOOK algorithm — reverses at last request.
NearestCar
Nearest-car — assigns closest idle elevator.
Etd
Estimated Time to Destination — minimizes total cost.
Destination
Hall-call destination dispatch — sticky per-rider assignment.
Rsr
Relative System Response — additive composite of ETA, direction, car-call affinity, and load-share terms.
LoopSweep
Continuous-patrol sweep for LineKind::Loop
groups. Loop cars never enter the Hungarian idle pool — the
kickstart pass and door FSM handle routing — so this variant is
a typed snapshot/config label rather than a ranking implementation.
Available only when the loop_lines cargo feature is enabled.
LoopSchedule
Fixed-dwell timetable for LineKind::Loop
groups. Overrides every Loop car in the group to a uniform
per-stop dwell, producing a predictable schedule rather than
rider-load-shaped variable dwell. Hold-recovery (extending
dwell for cars arriving early relative to the preceding car
in patrol order) is wired in a follow-up PR; the
target_headway_ticks field is round-trip-stable in the
meantime. Available only when the loop_lines cargo feature
is enabled.
Custom(String)
Custom strategy identified by name. The game must provide a factory.
Implementations§
Source§impl BuiltinStrategy
impl BuiltinStrategy
Sourcepub fn instantiate(&self) -> Option<Box<dyn DispatchStrategy>>
pub fn instantiate(&self) -> Option<Box<dyn DispatchStrategy>>
Instantiate the dispatch strategy for this variant.
Returns None for Custom — the game must provide those via
a factory function.
Trait Implementations§
Source§impl Clone for BuiltinStrategy
impl Clone for BuiltinStrategy
Source§fn clone(&self) -> BuiltinStrategy
fn clone(&self) -> BuiltinStrategy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BuiltinStrategy
impl Debug for BuiltinStrategy
Source§impl<'de> Deserialize<'de> for BuiltinStrategy
impl<'de> Deserialize<'de> for BuiltinStrategy
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>,
Source§impl Display for BuiltinStrategy
impl Display for BuiltinStrategy
Source§impl PartialEq for BuiltinStrategy
impl PartialEq for BuiltinStrategy
Source§fn eq(&self, other: &BuiltinStrategy) -> bool
fn eq(&self, other: &BuiltinStrategy) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for BuiltinStrategy
impl Serialize for BuiltinStrategy
impl Eq for BuiltinStrategy
impl StructuralPartialEq for BuiltinStrategy
Auto Trait Implementations§
impl Freeze for BuiltinStrategy
impl RefUnwindSafe for BuiltinStrategy
impl Send for BuiltinStrategy
impl Sync for BuiltinStrategy
impl Unpin for BuiltinStrategy
impl UnsafeUnpin for BuiltinStrategy
impl UnwindSafe for BuiltinStrategy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.