[][src]Struct ddo::core::common::Node

pub struct Node<T> {
    pub state: T,
    pub info: NodeInfo,
}

A node is the simplest constituent of an MDD. It basically consists of an user specified state together with some meta data (stored in a NodeInfo which does some bookkeeping about the position, longest path.. of this node in the decision diagram).

Fields

state: T

This is the (user-specified) state. It is the state reached by following the best path from the root node applying the transition relation at each decision.

info: NodeInfo

This is the node info which stores the metadata about the node.

Methods

impl<T> Node<T>[src]

pub fn new(
    state: T,
    lp_len: i32,
    lp_arc: Option<Edge>,
    is_exact: bool,
    is_relaxed: bool
) -> Node<T>
[src]

Constructor.

Creates a new node info from the state, longest path information (lp_len and lp_arc) and a flag indicating if this denotes an exaxct node or not. The upper bound is set to a default value (the greatest i32)

pub fn merged(state: T, lp_len: i32, lp_arc: Option<Edge>) -> Node<T>[src]

Alt-Constructor

This constructor explicitly creates a merged node. That is, a node which is going to be marked as 'not exact'.

Trait Implementations

impl<T: Clone> Clone for Node<T>[src]

impl<T> Compare<Node<T>, Node<T>> for MinLP[src]

impl<T> Compare<Node<T>, Node<T>> for MaxUB[src]

impl<T, F> Compare<Node<T>, Node<T>> for Func<F> where
    F: Clone + Fn(&Node<T>, &Node<T>) -> Ordering
[src]

If the function is a node comparator, then Func will auto implement the Compare trait for that function.

impl<T: Debug> Debug for Node<T>[src]

impl<T: Eq> Eq for Node<T>[src]

impl<T> Hash for Node<T> where
    T: Hash
[src]

fn hash<H: Hasher>(&self, state: &mut H)[src]

A node acts as a mere pass through for the state. Hence it is hashed on basis of the state only.

impl<T> PartialEq<Node<T>> for Node<T> where
    T: Eq
[src]

fn eq(&self, other: &Self) -> bool[src]

To be coherent with Hash, nodes implement an equality test that bears on the node state only.

impl<T> StructuralEq for Node<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Node<T> where
    T: RefUnwindSafe

impl<T> Send for Node<T> where
    T: Send

impl<T> Sync for Node<T> where
    T: Sync

impl<T> Unpin for Node<T> where
    T: Unpin

impl<T> UnwindSafe for Node<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.