1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
use crate::construction::heuristics::InsertionContext;
use crate::refinement::selection::Selection;
use crate::refinement::RefinementContext;

/// Selects a best solution from population.
pub struct SelectBest {}

impl Default for SelectBest {
    fn default() -> Self {
        Self {}
    }
}

impl Selection for SelectBest {
    fn select(&self, refinement_ctx: &mut RefinementContext) -> InsertionContext {
        refinement_ctx.population.best().unwrap().0.deep_copy()
    }
}