pub struct Decision<A: Action> {
pub action: A,
pub expected_loss: f64,
pub next_best_loss: f64,
pub log_posterior: f64,
pub confidence_interval: (f64, f64),
pub evidence: Vec<EvidenceTerm>,
}Expand description
Result of a decision: the chosen action plus evidence for the ledger.
Fields§
§action: AThe action chosen by expected-loss minimization.
expected_loss: f64Expected loss of the chosen action.
next_best_loss: f64Expected loss of the next-best action (for loss_avoided).
log_posterior: f64Log-posterior at decision time.
confidence_interval: (f64, f64)Confidence interval at decision time.
evidence: Vec<EvidenceTerm>Evidence terms contributing to this decision.
Implementations§
Source§impl<A: Action> Decision<A>
impl<A: Action> Decision<A>
Sourcepub fn loss_avoided(&self) -> f64
pub fn loss_avoided(&self) -> f64
Loss avoided by choosing this action over the next-best.
Sourcepub fn to_evidence_entry(
&self,
domain: DecisionDomain,
timestamp_ns: u64,
) -> EvidenceEntry
pub fn to_evidence_entry( &self, domain: DecisionDomain, timestamp_ns: u64, ) -> EvidenceEntry
Convert to a unified evidence entry for the ledger.
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for Decision<A>where
A: Freeze,
impl<A> RefUnwindSafe for Decision<A>where
A: RefUnwindSafe,
impl<A> Send for Decision<A>where
A: Send,
impl<A> Sync for Decision<A>where
A: Sync,
impl<A> Unpin for Decision<A>where
A: Unpin,
impl<A> UnsafeUnpin for Decision<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for Decision<A>where
A: UnwindSafe,
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