Struct vrp_core::models::solution::Tour[][src]

pub struct Tour { /* fields omitted */ }

Represents a tour, a smart container for jobs with their associated activities.

Implementations

impl Tour[src]

pub fn new(actor: &Actor) -> Self[src]

Creates a new tour with start and optional end using actor properties.

pub fn set_start(&mut self, activity: Activity) -> &mut Tour[src]

Sets tour start.

pub fn set_end(&mut self, activity: Activity) -> &mut Tour[src]

Sets tour end.

pub fn insert_last(&mut self, activity: Activity) -> &mut Tour[src]

Inserts activity within its job to the end of tour.

pub fn insert_at(&mut self, activity: Activity, index: usize) -> &mut Tour[src]

Inserts activity within its job at specified index.

pub fn remove(&mut self, job: &Job) -> bool[src]

Removes job within its activities from the tour.

pub fn remove_activity_at(&mut self, idx: usize) -> Job[src]

Removes activity and its job from the tour.

pub fn all_activities(&self) -> Iter<'_, Activity>[src]

Returns all activities in tour.

pub fn activities_slice(&self, start: usize, end: usize) -> &[Activity][src]

Returns activities slice in specific range (all inclusive).

pub fn all_activities_mut(&mut self) -> IterMut<'_, Activity>[src]

Returns all activities in tour as mutable.

pub fn job_activities<'a>(
    &'a self,
    job: &'a Job
) -> impl Iterator<Item = &Activity> + 'a
[src]

Returns all activities in tour for specific job.

pub fn legs<'a>(
    &'a self
) -> Box<dyn Iterator<Item = (&'a [Activity], usize)> + 'a>
[src]

Returns counted tour legs.

pub fn jobs(&self) -> impl Iterator<Item = Job> + '_[src]

Returns all jobs.

pub fn get(&self, index: usize) -> Option<&Activity>[src]

Returns activity by its index in tour.

pub fn get_mut(&mut self, index: usize) -> Option<&mut Activity>[src]

Returns mutable activity by its index in tour.

pub fn start(&self) -> Option<&Activity>[src]

Returns start activity in tour.

pub fn end(&self) -> Option<&Activity>[src]

Returns end activity in tour.

pub fn contains(&self, job: &Job) -> bool[src]

Checks whether job is present in tour

pub fn index(&self, job: &Job) -> Option<usize>[src]

Returns index of first job occurrence in the tour.

pub fn has_jobs(&self) -> bool[src]

Checks whether tour has jobs.

pub fn activity_count(&self) -> usize[src]

Returns amount of job activities.

pub fn total(&self) -> usize[src]

Returns amount of all activities in tour.

pub fn job_count(&self) -> usize[src]

Returns amount of jobs.

pub fn deep_copy(&self) -> Tour[src]

Creates a copy of existing tour deeply copying all activities and jobs.

Trait Implementations

impl Default for Tour[src]

Auto Trait Implementations

impl !RefUnwindSafe for Tour

impl Send for Tour

impl Sync for Tour

impl Unpin for Tour

impl !UnwindSafe for Tour

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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