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

source

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

source§

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

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

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)>>

Gets route intervals split by marker jobs.
source§

fn get_interval_key(&self) -> Option<StateKey>

Gets interval state key if present.
source§

fn update_solution_intervals(&self, solution_ctx: &mut SolutionContext)

Update route intervals on solution level.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V