ScoreBounder

Trait ScoreBounder 

Source
pub trait ScoreBounder<S: PlanningSolution>: Send + Debug {
    // Required method
    fn calculate_optimistic_bound(
        &self,
        score_director: &dyn ScoreDirector<S>,
    ) -> Option<S::Score>;

    // Provided method
    fn calculate_pessimistic_bound(
        &self,
        score_director: &dyn ScoreDirector<S>,
    ) -> Option<S::Score> { ... }
}
Expand description

Calculates score bounds for exhaustive search pruning.

The bounder estimates the best possible score that can be achieved from a partial solution state. If this optimistic bound is worse than the best complete solution found so far, the branch can be pruned.

Required Methods§

Source

fn calculate_optimistic_bound( &self, score_director: &dyn ScoreDirector<S>, ) -> Option<S::Score>

Calculates the optimistic bound for the current solution state.

The optimistic bound is an upper bound on the score achievable from this partial solution. It should be:

  • Fast to compute
  • Greater than or equal to any actual achievable score

Returns None if no bound can be computed.

Provided Methods§

Source

fn calculate_pessimistic_bound( &self, score_director: &dyn ScoreDirector<S>, ) -> Option<S::Score>

Calculates the pessimistic bound for the current solution state.

The pessimistic bound is a lower bound on the score achievable from this partial solution. This is less commonly used but can help with certain heuristics.

Returns None if no bound can be computed.

Implementations on Foreign Types§

Source§

impl<S: PlanningSolution> ScoreBounder<S> for ()

Source§

fn calculate_optimistic_bound( &self, _score_director: &dyn ScoreDirector<S>, ) -> Option<S::Score>

Implementors§