Struct vrp_core::construction::heuristics::InsertionContext
source · pub struct InsertionContext {
pub problem: Arc<Problem>,
pub solution: SolutionContext,
pub environment: Arc<Environment>,
}
Expand description
A context which contains information needed for heuristic and metaheuristic.
Fields§
§problem: Arc<Problem>
Original problem.
solution: SolutionContext
Solution context: discovered solution.
environment: Arc<Environment>
Information about environment.
Implementations§
source§impl InsertionContext
impl InsertionContext
sourcepub fn new(problem: Arc<Problem>, environment: Arc<Environment>) -> Self
pub fn new(problem: Arc<Problem>, environment: Arc<Environment>) -> Self
Creates insertion context for given problem with unassigned jobs.
sourcepub fn new_empty(problem: Arc<Problem>, environment: Arc<Environment>) -> Self
pub fn new_empty(problem: Arc<Problem>, environment: Arc<Environment>) -> Self
Creates insertion context for given problem with empty solution.
sourcepub fn new_from_solution(
problem: Arc<Problem>,
solution: (Solution, Option<Cost>),
environment: Arc<Environment>
) -> Self
pub fn new_from_solution( problem: Arc<Problem>, solution: (Solution, Option<Cost>), environment: Arc<Environment> ) -> Self
Creates insertion context from existing solution.
sourcepub fn get_total_cost(&self) -> Option<Cost>
pub fn get_total_cost(&self) -> Option<Cost>
Gets total cost of the solution.
Returns None if cost cannot be calculate as the context is in non-consistent state.
Trait Implementations§
source§impl Debug for InsertionContext
impl Debug for InsertionContext
source§impl DominanceOrdered for InsertionContext
impl DominanceOrdered for InsertionContext
source§fn get_order(&self) -> &DominanceOrder
fn get_order(&self) -> &DominanceOrder
Gets dominance order in the population.
source§fn set_order(&mut self, order: DominanceOrder)
fn set_order(&mut self, order: DominanceOrder)
Sets dominance order in the population.
source§impl From<InsertionContext> for Solution
impl From<InsertionContext> for Solution
source§fn from(insertion_ctx: InsertionContext) -> Self
fn from(insertion_ctx: InsertionContext) -> Self
Converts to this type from the input type.
source§impl HeuristicSolution for InsertionContext
impl HeuristicSolution for InsertionContext
source§impl RosomaxaWeighted for InsertionContext
impl RosomaxaWeighted for InsertionContext
source§fn init_weights(&mut self)
fn init_weights(&mut self)
Initializes weights.
Auto Trait Implementations§
impl !RefUnwindSafe for InsertionContext
impl Send for InsertionContext
impl Sync for InsertionContext
impl Unpin for InsertionContext
impl !UnwindSafe for InsertionContext
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