pub struct Mass<B: Postings> { /* private fields */ }Expand description
A Basic Belief Assignment: mass distributed over focal sets.
Invariants from §4.1: m(∅) = 0, and the masses sum to 1. Both are checked on construction rather than
assumed, because a mass function that does not sum to 1 produces belief values that look plausible and are
meaningless.
Implementations§
Source§impl<B: Postings> Mass<B>
impl<B: Postings> Mass<B>
Sourcepub fn new(focals: Vec<(B, f64)>) -> Result<Self, EvidenceError>
pub fn new(focals: Vec<(B, f64)>) -> Result<Self, EvidenceError>
Build a mass function, checking the §4.1 invariants.
Sourcepub fn certain(set: B) -> Result<Self, EvidenceError>
pub fn certain(set: B) -> Result<Self, EvidenceError>
All mass on one set — a single source asserting one possibility with full confidence.
Sourcepub fn vacuous(frame: B) -> Result<Self, EvidenceError>
pub fn vacuous(frame: B) -> Result<Self, EvidenceError>
All mass on the frame itself: the honest representation of knowing nothing. This is the state a point-estimate probability cannot express, and combining it with anything returns that thing unchanged.
pub fn focals(&self) -> &[(B, f64)]
Sourcepub fn belief(&self, a: &B) -> f64
pub fn belief(&self, a: &B) -> f64
Bel(A) = Σ_{B ⊆ A} m(B) — mass that commits entirely to A. The lower bound.
Sourcepub fn plausibility(&self, a: &B) -> f64
pub fn plausibility(&self, a: &B) -> f64
Pl(A) = Σ_{B ∩ A ≠ ∅} m(B) — mass not ruling A out. The upper bound.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for Mass<B>
impl<B> RefUnwindSafe for Mass<B>
impl<B> Send for Mass<B>
impl<B> Sync for Mass<B>
impl<B> Unpin for Mass<B>
impl<B> UnsafeUnpin for Mass<B>
impl<B> UnwindSafe for Mass<B>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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