pub struct PlanGraph<'a, ActionId: Eq + Hash + Ord + PartialOrd + Clone + Debug, PropositionId: Eq + Hash + Ord + PartialOrd + Clone + Debug + Display> {
pub goals: HashSet<&'a Proposition<PropositionId>>,
pub actions: HashSet<&'a Action<'a, ActionId, PropositionId>>,
pub layers: Vec<Layer<'a, ActionId, PropositionId>>,
pub mutex_props: HashMap<usize, HashSet<PairSet<&'a Proposition<PropositionId>>>>,
pub mutex_actions: HashMap<usize, HashSet<PairSet<&'a Action<'a, ActionId, PropositionId>>>>,
}
Fields§
§goals: HashSet<&'a Proposition<PropositionId>>
§actions: HashSet<&'a Action<'a, ActionId, PropositionId>>
§layers: Vec<Layer<'a, ActionId, PropositionId>>
§mutex_props: HashMap<usize, HashSet<PairSet<&'a Proposition<PropositionId>>>>
§mutex_actions: HashMap<usize, HashSet<PairSet<&'a Action<'a, ActionId, PropositionId>>>>
Implementations§
Source§impl<'a, ActionId: Eq + Hash + Ord + PartialOrd + Clone + Debug, PropositionId: Eq + Hash + Ord + PartialOrd + Clone + Debug + Display> PlanGraph<'a, ActionId, PropositionId>
impl<'a, ActionId: Eq + Hash + Ord + PartialOrd + Clone + Debug, PropositionId: Eq + Hash + Ord + PartialOrd + Clone + Debug + Display> PlanGraph<'a, ActionId, PropositionId>
pub fn new( initial_props: HashSet<&'a Proposition<PropositionId>>, goals: HashSet<&'a Proposition<PropositionId>>, actions: HashSet<&'a Action<'_, ActionId, PropositionId>>, ) -> Self
pub fn push(&mut self, layer: Layer<'a, ActionId, PropositionId>)
Sourcepub fn extend(&mut self) -> &mut Self
pub fn extend(&mut self) -> &mut Self
Extends the plangraph to depth i+1 Inserts another action layer and proposition layer
Sourcepub fn has_possible_solution(&self) -> bool
pub fn has_possible_solution(&self) -> bool
A solution is possible if all goals exist in the last proposition layer and are not mutex
Sourcepub fn has_leveled_off(&self) -> bool
pub fn has_leveled_off(&self) -> bool
The graph is considered to have “leveled off” when proposition layer P and an adjacent proposition layer Q are equal
Trait Implementations§
Auto Trait Implementations§
impl<'a, ActionId, PropositionId> Freeze for PlanGraph<'a, ActionId, PropositionId>
impl<'a, ActionId, PropositionId> RefUnwindSafe for PlanGraph<'a, ActionId, PropositionId>where
PropositionId: RefUnwindSafe,
ActionId: RefUnwindSafe,
impl<'a, ActionId, PropositionId> Send for PlanGraph<'a, ActionId, PropositionId>
impl<'a, ActionId, PropositionId> Sync for PlanGraph<'a, ActionId, PropositionId>
impl<'a, ActionId, PropositionId> Unpin for PlanGraph<'a, ActionId, PropositionId>
impl<'a, ActionId, PropositionId> UnwindSafe for PlanGraph<'a, ActionId, PropositionId>where
PropositionId: RefUnwindSafe,
ActionId: RefUnwindSafe,
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