[−][src]Struct ddo::core::common::NodeInfo
The partial assignments (derived from longest paths in the MDD) form a
chained structure. This structure is made of NodeInfo
inter-connected by
Edges
. An NodeInfo
keeps track of the metadata associated to a node.
Namely, it is the NodeInfo
which is capable of telling if the node is
exact, the length of the longest path to it, etc..
Because the chained structure is reference counted, the NodeInfo
+ Edge
representation is very efficient as it allows to pune the tree-shaped structure
and forget about paths that are no longer relevant.
Fields
is_exact: bool
This flag is true iff the node owning this node-info is exact
is_relaxed: bool
This flag is true iff the node owning this node-info was created
as the result of a node-merger during a relaxation step
(see Relaxation.merge_nodes()
).
lp_len: i32
The length of the longest path from the root node of the problem
to the node owner of this NodeInfo
.
lp_arc: Option<Edge>
The edge to the parent of this node along the longest path from root to here. The only case where this field should be None is at the root node of the problem. All other nodes should know their "best parent" and have a way to access it through here.
ub: i32
An upper bound on the best objective value attainable going through this node. (It is not the role of a nodeinfo to compute this value. The upper bound information is computed by the problem relaxation).
Methods
impl NodeInfo
[src]
pub fn new(
lp_len: i32,
lp_arc: Option<Edge>,
is_exact: bool,
is_relaxed: bool
) -> NodeInfo
[src]
lp_len: i32,
lp_arc: Option<Edge>,
is_exact: bool,
is_relaxed: bool
) -> NodeInfo
Constructor.
Creates a new node info from the longest path information
(lp_len
and lp_arc
) along with 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 merge(&mut self, other: Self)
[src]
Merge other into this node. That is to say, it combines the information from two nodes that are logically equivalent (should be the same). Concretely, it means that it possibly updates the current node to keep the best longest path info, track the 'exactitude' of the node and keep the tightest upper bound.
Important note
This has nothing to do with the user-provided merge_*
operators !
pub fn longest_path(&self) -> Vec<Decision>
[src]
Returns the longest path (sequence of decisions) from the root of the problem until this node.
pub fn has_exact_best(&self) -> bool
[src]
Returns true iff the parent of this node is either non existent or not a relaxed node.
Trait Implementations
impl Clone for NodeInfo
[src]
impl Debug for NodeInfo
[src]
impl Eq for NodeInfo
[src]
impl Ord for NodeInfo
[src]
NodeInfo
s can be ordered by considering their upper bound, the length of
their longest path and their exactitude.
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<NodeInfo> for NodeInfo
[src]
Two NodeInfo
are (partially) equivalent if they are both exact, have the
same longest path and upper bound.
impl PartialOrd<NodeInfo> for NodeInfo
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for NodeInfo
[src]
Auto Trait Implementations
impl RefUnwindSafe for NodeInfo
impl Send for NodeInfo
impl Sync for NodeInfo
impl Unpin for NodeInfo
impl UnwindSafe for NodeInfo
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,