Skip to main content

Heuristic

Trait Heuristic 

Source
pub trait Heuristic: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn estimate(&self, task: &Task, state: &State) -> HValue;

    // Provided method
    fn preferred_ops(&self, _task: &Task, _state: &State) -> &[OpId] { ... }
}
Expand description

A heuristic function for estimating the cost to reach the goal.

Implementors must be Send + Sync for use in multi-threaded contexts.

Required Methods§

Source

fn name(&self) -> &str

A human-readable name for this heuristic.

Source

fn estimate(&self, task: &Task, state: &State) -> HValue

Estimate the cost from state to the goal in task.

Provided Methods§

Source

fn preferred_ops(&self, _task: &Task, _state: &State) -> &[OpId]

Return preferred operators for the current state (used by some planners). The default implementation returns an empty slice.

Implementors§