Struct vrp_core::construction::enablers::FixedRouteIntervals
source · pub struct FixedRouteIntervals {
pub is_marker_single_fn: Box<dyn Fn(&Single) -> bool + Send + Sync>,
pub is_new_interval_needed_fn: Box<dyn Fn(&RouteContext) -> bool + Send + Sync>,
pub is_obsolete_interval_fn: Box<dyn Fn(&RouteContext, Range<usize>, Range<usize>) -> bool + Send + Sync>,
pub is_assignable_fn: Box<dyn Fn(&Route, &Job) -> bool + Send + Sync>,
pub intervals_key: StateKey,
}
Expand description
Provides a basic implementation of route intervals functionality.
Fields§
§is_marker_single_fn: Box<dyn Fn(&Single) -> bool + Send + Sync>
Checks whether specified single job is of marker type.
is_new_interval_needed_fn: Box<dyn Fn(&RouteContext) -> bool + Send + Sync>
Specifies a function which checks whether a new interval is needed for given route.
is_obsolete_interval_fn: Box<dyn Fn(&RouteContext, Range<usize>, Range<usize>) -> bool + Send + Sync>
Specifies an obsolete interval function which takes left and right interval range. These intervals are separated by marker job activity.
is_assignable_fn: Box<dyn Fn(&Route, &Job) -> bool + Send + Sync>
Specifies a function which checks whether job can be assigned to a given route.
intervals_key: StateKey
An intervals state key.
Implementations§
source§impl FixedRouteIntervals
impl FixedRouteIntervals
sourcepub fn resolve_marker_intervals<'a>(
&self,
route_ctx: &'a RouteContext
) -> impl Iterator<Item = (usize, usize)> + 'a
pub fn resolve_marker_intervals<'a>( &self, route_ctx: &'a RouteContext ) -> impl Iterator<Item = (usize, usize)> + 'a
Returns marker intervals or default interval [0, tour_size).
Trait Implementations§
source§impl RouteIntervals for FixedRouteIntervals
impl RouteIntervals for FixedRouteIntervals
source§fn is_marker_job(&self, job: &Job) -> bool
fn is_marker_job(&self, job: &Job) -> bool
Returns true if job is considered as a route interval marker.
source§fn is_marker_assignable(&self, route: &Route, job: &Job) -> bool
fn is_marker_assignable(&self, route: &Route, job: &Job) -> bool
Returns true if given job is a marker job and can be used with given route.
source§fn is_new_interval_needed(&self, route_ctx: &RouteContext) -> bool
fn is_new_interval_needed(&self, route_ctx: &RouteContext) -> bool
Checks whether vehicle can do a new route interval.
source§fn get_marker_intervals<'a>(
&self,
route_ctx: &'a RouteContext
) -> Option<&'a Vec<(usize, usize)>>
fn get_marker_intervals<'a>( &self, route_ctx: &'a RouteContext ) -> Option<&'a Vec<(usize, usize)>>
Gets route intervals split by marker jobs.
source§fn get_interval_key(&self) -> Option<StateKey>
fn get_interval_key(&self) -> Option<StateKey>
Gets interval state key if present.
source§fn update_solution_intervals(&self, solution_ctx: &mut SolutionContext)
fn update_solution_intervals(&self, solution_ctx: &mut SolutionContext)
Update route intervals on solution level.
Auto Trait Implementations§
impl !RefUnwindSafe for FixedRouteIntervals
impl Send for FixedRouteIntervals
impl Sync for FixedRouteIntervals
impl Unpin for FixedRouteIntervals
impl !UnwindSafe for FixedRouteIntervals
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