pub trait ProblemSpace {
    type State: Copy + Eq + Hash;
    type Iter: Iterator<Item = (Self::State, f64)>;

    // Required methods
    fn heuristic(&self, _: &Self::State, _: &Self::State) -> f64;
    fn succ(&self, _: &Self::State) -> Self::Iter;
    fn pred(&self, _: &Self::State) -> Self::Iter;
}
Expand description

Public trait which - once implemented - describes the problem space to solve.

Required Associated Types§

source

type State: Copy + Eq + Hash

Defines the type of your state.

source

type Iter: Iterator<Item = (Self::State, f64)>

Iterator for containing states and cost/utility to transition to it.

Required Methods§

source

fn heuristic(&self, _: &Self::State, _: &Self::State) -> f64

Heuristic function to calculate the “distance” between two states.

source

fn succ(&self, _: &Self::State) -> Self::Iter

Given a state calculates the successor states.

source

fn pred(&self, _: &Self::State) -> Self::Iter

Given a state calculates the predecessor states.

Implementors§