Struct vrp_core::solver::RefinementContext
source · pub struct RefinementContext {
pub problem: Arc<Problem>,
pub environment: Arc<Environment>,
pub state: HashMap<String, Box<dyn Any + Sync + Send>>,
/* private fields */
}Expand description
A type which encapsulates information needed to perform solution refinement process.
Fields§
§problem: Arc<Problem>Original problem definition.
environment: Arc<Environment>An environmental context.
state: HashMap<String, Box<dyn Any + Sync + Send>>A collection of data associated with refinement process.
Implementations§
source§impl RefinementContext
impl RefinementContext
sourcepub fn new(
problem: Arc<Problem>,
population: TargetPopulation,
telemetry_mode: TelemetryMode,
environment: Arc<Environment>
) -> Self
pub fn new( problem: Arc<Problem>, population: TargetPopulation, telemetry_mode: TelemetryMode, environment: Arc<Environment> ) -> Self
Creates a new instance of RefinementContext.
sourcepub fn add_solution(&mut self, solution: InsertionContext)
pub fn add_solution(&mut self, solution: InsertionContext)
Adds solution to population.
Trait Implementations§
source§impl HeuristicContext for RefinementContext
impl HeuristicContext for RefinementContext
§type Objective = GoalContext
type Objective = GoalContext
A heuristic objective function type.
§type Solution = InsertionContext
type Solution = InsertionContext
A heuristic solution type.
source§fn population(&self) -> &DynHeuristicPopulation<Self::Objective, Self::Solution>
fn population(&self) -> &DynHeuristicPopulation<Self::Objective, Self::Solution>
Returns current population.
source§fn statistics(&self) -> &HeuristicStatistics
fn statistics(&self) -> &HeuristicStatistics
Returns current statistic used to track the search progress.
source§fn environment(&self) -> &Environment
fn environment(&self) -> &Environment
Returns environment.
source§fn on_initial(&mut self, solution: Self::Solution, item_time: Timer)
fn on_initial(&mut self, solution: Self::Solution, item_time: Timer)
Updates population with initial solution.