Enum vrp_core::construction::heuristics::InsertionResult
source · pub enum InsertionResult {
Success(InsertionSuccess),
Failure(InsertionFailure),
}
Expand description
Specifies insertion result variant.
Variants§
Implementations§
source§impl InsertionResult
impl InsertionResult
sourcepub fn make_success(
cost: InsertionCost,
job: Job,
activities: Vec<(Activity, usize)>,
route_ctx: &RouteContext
) -> Self
pub fn make_success( cost: InsertionCost, job: Job, activities: Vec<(Activity, usize)>, route_ctx: &RouteContext ) -> Self
Creates result which represents insertion success.
sourcepub fn make_failure() -> Self
pub fn make_failure() -> Self
Creates result which represents insertion failure.
sourcepub fn make_failure_with_code(
code: i32,
stopped: bool,
job: Option<Job>
) -> Self
pub fn make_failure_with_code( code: i32, stopped: bool, job: Option<Job> ) -> Self
Creates result which represents insertion failure with given code.
sourcepub fn choose_best_result(left: Self, right: Self) -> Self
pub fn choose_best_result(left: Self, right: Self) -> Self
Compares two insertion results and returns the cheapest by cost.
sourcepub fn as_success(&self) -> Option<&InsertionSuccess>
pub fn as_success(&self) -> Option<&InsertionSuccess>
Returns insertion result as success.
Trait Implementations§
source§impl Debug for InsertionResult
impl Debug for InsertionResult
source§impl TryFrom<InsertionResult> for InsertionSuccess
impl TryFrom<InsertionResult> for InsertionSuccess
§type Error = InsertionFailure
type Error = InsertionFailure
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl !RefUnwindSafe for InsertionResult
impl Send for InsertionResult
impl Sync for InsertionResult
impl Unpin for InsertionResult
impl !UnwindSafe for InsertionResult
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