pub struct HMax(/* private fields */);Expand description
The max heuristic h^max (Bonet and Geffner 2001) seeded with fact
prices: admissible on decoupled states.
A completion through a member state pays the prices of its leaf states,
at least the largest price of any fact it uses, and then at least h^max
of that state; seeding every fact with its price can only lower the
estimate. The relaxation runs over all operators of the original task,
leaf actions included.
§Examples
use decoupled_search::{Factoring, HMax, astar};
use sas_plus::{Effect, Fact, Operator, State, Task, Variable};
let op = |pre: Vec<Fact>, eff: Fact| Operator {
name: "op".into(),
pre,
eff: vec![Effect::new(eff)],
cost: 2,
};
let task = Task {
variables: vec![Variable::new("truck", 2), Variable::new("pkg", 3)],
operators: vec![
op(vec![Fact::new(0, 0)], Fact::new(0, 1)),
op(vec![Fact::new(0, 0), Fact::new(1, 0)], Fact::new(1, 2)),
op(vec![Fact::new(0, 1), Fact::new(1, 2)], Fact::new(1, 1)),
],
initial: State(vec![0, 0]),
goal: vec![Fact::new(1, 1)],
axioms: vec![],
};
let plan = astar(&task, &Factoring::fork(&task), &HMax::new(&task))?.expect("solvable");
assert_eq!(plan.cost, 6);Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Forget for HMax
impl Freeze for HMax
impl Move for HMax
impl RefUnwindSafe for HMax
impl Send for HMax
impl Sync for HMax
impl Unpin for HMax
impl UnsafeUnpin for HMax
impl UnwindSafe for HMax
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more