solverforge_solver/phase/localsearch/acceptor/
hill_climbing.rs1use std::fmt::Debug;
4
5use solverforge_core::domain::PlanningSolution;
6
7use super::Acceptor;
8use crate::heuristic::r#move::MoveTabuSignature;
9
10#[derive(Debug, Clone, Default)]
24pub struct HillClimbingAcceptor;
25
26impl HillClimbingAcceptor {
27 pub fn new() -> Self {
28 Self
29 }
30}
31
32impl<S: PlanningSolution> Acceptor<S> for HillClimbingAcceptor {
33 fn is_accepted(
34 &mut self,
35 last_step_score: &S::Score,
36 move_score: &S::Score,
37 _move_signature: Option<&MoveTabuSignature>,
38 ) -> bool {
39 move_score > last_step_score
41 }
42}