pub struct DispatchContext<'a> {
pub route: &'a Route,
pub now_s: f64,
pub active_vehicles: usize,
pub max_active_vehicles: Option<usize>,
}Expand description
Dispatch request context for one route at one simulation time.
Fields§
§route: &'a RouteRoute being considered for dispatch.
now_s: f64Current simulation time in seconds.
active_vehicles: usizeNumber of currently active vehicles assigned to this route.
max_active_vehicles: Option<usize>Optional active-vehicle cap for this route.
Implementations§
Source§impl<'a> DispatchContext<'a>
impl<'a> DispatchContext<'a>
Sourcepub fn new(route: &'a Route, now_s: f64) -> DispatchContext<'a>
pub fn new(route: &'a Route, now_s: f64) -> DispatchContext<'a>
Create a dispatch context for route at now_s.
Sourcepub fn with_active_vehicles(
self,
active_vehicles: usize,
max_active_vehicles: Option<usize>,
) -> DispatchContext<'a>
pub fn with_active_vehicles( self, active_vehicles: usize, max_active_vehicles: Option<usize>, ) -> DispatchContext<'a>
Attach active-vehicle counts and an optional cap.
Trait Implementations§
Source§impl<'a> Clone for DispatchContext<'a>
impl<'a> Clone for DispatchContext<'a>
Source§fn clone(&self) -> DispatchContext<'a>
fn clone(&self) -> DispatchContext<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for DispatchContext<'a>
impl<'a> Debug for DispatchContext<'a>
impl<'a> Copy for DispatchContext<'a>
Auto Trait Implementations§
impl<'a> Freeze for DispatchContext<'a>
impl<'a> RefUnwindSafe for DispatchContext<'a>
impl<'a> Send for DispatchContext<'a>
impl<'a> Sync for DispatchContext<'a>
impl<'a> Unpin for DispatchContext<'a>
impl<'a> UnsafeUnpin for DispatchContext<'a>
impl<'a> UnwindSafe for DispatchContext<'a>
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