Struct vrp_core::construction::features::RechargeFeatureBuilder
source · pub struct RechargeFeatureBuilder { /* private fields */ }Expand description
Provides a way to build the recharge/refuel feature.
Implementations§
source§impl RechargeFeatureBuilder
impl RechargeFeatureBuilder
sourcepub fn set_violation_code(self, violation_code: ViolationCode) -> Self
pub fn set_violation_code(self, violation_code: ViolationCode) -> Self
Sets constraint violation code which is used to report back the reason of job’s unassignment.
sourcepub fn set_transport(
self,
transport: Arc<dyn TransportCost + Send + Sync>,
) -> Self
pub fn set_transport( self, transport: Arc<dyn TransportCost + Send + Sync>, ) -> Self
Sets transport costs to estimate distance.
sourcepub fn set_is_recharge_single<F>(self, func: F) -> Self
pub fn set_is_recharge_single<F>(self, func: F) -> Self
Sets a function which specifies whether a given single job can be considered as a recharge job.
sourcepub fn set_belongs_to_route<F>(self, func: F) -> Self
pub fn set_belongs_to_route<F>(self, func: F) -> Self
Sets a function which specifies whether a given route can serve a given job. This function should return false, if the job is not recharge.
sourcepub fn set_distance_limit<F>(self, func: F) -> Self
pub fn set_distance_limit<F>(self, func: F) -> Self
Specifies a distance limit function for recharge. It should return a fixed value for the same actor all the time.
sourcepub fn build(&mut self) -> GenericResult<Feature>
pub fn build(&mut self) -> GenericResult<Feature>
Builds the recharge feature if all dependencies are set.
Auto Trait Implementations§
impl Freeze for RechargeFeatureBuilder
impl !RefUnwindSafe for RechargeFeatureBuilder
impl Send for RechargeFeatureBuilder
impl Sync for RechargeFeatureBuilder
impl Unpin for RechargeFeatureBuilder
impl !UnwindSafe for RechargeFeatureBuilder
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more