Struct vrp_core::construction::heuristics::SolutionContext
source · pub struct SolutionContext {
pub required: Vec<Job>,
pub ignored: Vec<Job>,
pub unassigned: HashMap<Job, UnassignmentInfo>,
pub locked: HashSet<Job>,
pub routes: Vec<RouteContext>,
pub registry: RegistryContext,
pub state: HashMap<StateKey, StateValue>,
}
Expand description
Contains information regarding discovered solution.
Fields§
§required: Vec<Job>
List of jobs which require permanent assignment.
ignored: Vec<Job>
List of jobs which at the moment does not require assignment and might be ignored.
unassigned: HashMap<Job, UnassignmentInfo>
Map of jobs which cannot be assigned and within reason code.
locked: HashSet<Job>
Specifies jobs which should not be affected by ruin.
routes: Vec<RouteContext>
Set of routes within their state.
registry: RegistryContext
Keeps track of used routes and resources.
state: HashMap<StateKey, StateValue>
A collection of data associated with solution.
Implementations§
source§impl SolutionContext
impl SolutionContext
sourcepub fn get_jobs_amount(&self) -> usize
pub fn get_jobs_amount(&self) -> usize
Returns amount of jobs considered by solution context. NOTE: the amount can be different for partially solved problem from original problem.
sourcepub fn keep_routes(&mut self, predicate: &dyn Fn(&RouteContext) -> bool)
pub fn keep_routes(&mut self, predicate: &dyn Fn(&RouteContext) -> bool)
Keep routes for which given predicate returns true.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SolutionContext
impl Send for SolutionContext
impl Sync for SolutionContext
impl Unpin for SolutionContext
impl !UnwindSafe for SolutionContext
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