Skip to content

praxis_cli / cli / event_tree


Module event_tree

Contents

Quick Reference

ItemKindDescription
SequenceBddstruct
SequenceIntermediatestruct
parse_model_with_libs_from_parsedfn
event_names_from_pdagfn
enumerate_cut_sets_etfn
truncation_scalefnThe factor folded into every product's value before it meets the cut-off.
sequence_below_cut_offfnWhether no product of this sequence can reach the cut-off.
apply_zbdd_filters_etfn
compute_approx_etfn
build_sequence_bdd_forfnBuild one sequence's BDD, together with the BDDs of the systems it succeeded so that delete-term can subtract their cut sets afterwards.
analytic_zbdd_wf1_no_approx_no_limitsfn
analytic_zbdd_wf2_approx_no_limitsfn
analytic_zbdd_wf3_no_approx_limitsfn
analytic_zbdd_wf4_approx_limitsfn
run_monte_carlo_implfn
run_monte_carlo_from_parsedfn
run_analytic_implfn
run_analytic_from_parsedfn
select_event_trees_to_runfn
ParsedModelWithLibstype

Structs

SequenceBdd

rust
struct SequenceBdd {
    variable_order: Vec<praxis::algorithms::pdag::NodeIndex>,
    bdd: praxis::algorithms::bdd_engine::Bdd,
    root: praxis::algorithms::bdd_engine::BddRef,
    delete_roots: Vec<praxis::algorithms::bdd_engine::BddRef>,
    probability: f64,
}

Trait Implementations

impl<ST> CastableFrom for SequenceBdd
impl Instrument for SequenceBdd
impl IntoEither for SequenceBdd
impl Pointable for SequenceBdd
  • <span id="sequencebdd-pointable-const-align"></span>const ALIGN: usize

  • <span id="sequencebdd-pointable-type-init"></span>type Init = T

  • <span id="sequencebdd-pointable-init"></span>unsafe fn init(init: <T as Pointable>::Init) -> usize

  • <span id="sequencebdd-pointable-deref"></span>unsafe fn deref<'a>(ptr: usize) -> &'a T

  • <span id="sequencebdd-pointable-deref-mut"></span>unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

  • <span id="sequencebdd-pointable-drop"></span>unsafe fn drop(ptr: usize)

impl Read for SequenceBdd
impl Same for SequenceBdd
  • <span id="sequencebdd-same-type-output"></span>type Output = T
impl<SS> SupersetOf for SequenceBdd
  • <span id="sequencebdd-supersetof-to-subset"></span>fn to_subset(&self) -> Option<SS>

  • <span id="sequencebdd-supersetof-is-in-subset"></span>fn is_in_subset(&self) -> bool

  • <span id="sequencebdd-supersetof-to-subset-unchecked"></span>fn to_subset_unchecked(&self) -> SS

  • <span id="sequencebdd-supersetof-from-subset"></span>fn from_subset(element: &SS) -> SP

impl<V> VZip for SequenceBdd
  • <span id="sequencebdd-vzip"></span>fn vzip(self) -> V
impl WithSubscriber for SequenceBdd

SequenceIntermediate

rust
struct SequenceIntermediate {
    seq_id: String,
    event_names: Vec<Option<String>>,
    zbdd: praxis::algorithms::zbdd_engine::ZbddEngine,
    zbdd_root: praxis::algorithms::zbdd_engine::ZbddRef,
    probability: f64,
    ie_frequency: f64,
    is_unconditional: bool,
}

Trait Implementations

impl<ST> CastableFrom for SequenceIntermediate
impl Instrument for SequenceIntermediate
impl IntoEither for SequenceIntermediate
impl Pointable for SequenceIntermediate
  • <span id="sequenceintermediate-pointable-const-align"></span>const ALIGN: usize

  • <span id="sequenceintermediate-pointable-type-init"></span>type Init = T

  • <span id="sequenceintermediate-pointable-init"></span>unsafe fn init(init: <T as Pointable>::Init) -> usize

  • <span id="sequenceintermediate-pointable-deref"></span>unsafe fn deref<'a>(ptr: usize) -> &'a T

  • <span id="sequenceintermediate-pointable-deref-mut"></span>unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

  • <span id="sequenceintermediate-pointable-drop"></span>unsafe fn drop(ptr: usize)

impl Read for SequenceIntermediate
impl Same for SequenceIntermediate
  • <span id="sequenceintermediate-same-type-output"></span>type Output = T
impl<SS> SupersetOf for SequenceIntermediate
  • <span id="sequenceintermediate-supersetof-to-subset"></span>fn to_subset(&self) -> Option<SS>

  • <span id="sequenceintermediate-supersetof-is-in-subset"></span>fn is_in_subset(&self) -> bool

  • <span id="sequenceintermediate-supersetof-to-subset-unchecked"></span>fn to_subset_unchecked(&self) -> SS

  • <span id="sequenceintermediate-supersetof-from-subset"></span>fn from_subset(element: &SS) -> SP

impl<V> VZip for SequenceIntermediate
  • <span id="sequenceintermediate-vzip"></span>fn vzip(self) -> V
impl WithSubscriber for SequenceIntermediate

Functions

parse_model_with_libs_from_parsed

rust
fn parse_model_with_libs_from_parsed(parsed: &praxis::io::event_tree_parser::EventTreeModel) -> Result<(praxis::core::model::Model, Vec<praxis::core::event_tree::InitiatingEvent>, Vec<praxis::core::event_tree::EventTree>, std::collections::HashMap<String, praxis::core::event_tree::EventTree>), Box<dyn std::error::Error>>

event_names_from_pdag

rust
fn event_names_from_pdag(pdag: &praxis::algorithms::pdag::Pdag, order: &[praxis::algorithms::pdag::NodeIndex]) -> Vec<Option<String>>

enumerate_cut_sets_et

rust
fn enumerate_cut_sets_et(zbdd: &praxis::algorithms::zbdd_engine::ZbddEngine, root: praxis::algorithms::zbdd_engine::ZbddRef, event_names: &[Option<String>]) -> Vec<praxis::algorithms::mocus::CutSet>

truncation_scale

rust
fn truncation_scale(basis: crate::cli::args::CutOffBasis, ie_frequency: f64) -> f64

The factor folded into every product's value before it meets the cut-off. On the frequency basis a sequence product is worth its probability times the initiating-event frequency, so the cut-off is compared against a frequency; on the probability basis the products keep their bare probability.

sequence_below_cut_off

rust
fn sequence_below_cut_off(scale: f64, probability: f64, cut_off: Option<f64>) -> bool

Whether no product of this sequence can reach the cut-off. A product's true weight is P(product AND sequence), which is bounded by both P(product) and the sequence's own probability, so once the sequence itself falls below the cut-off every product provably does too and the list is empty. This is what keeps a sequence that a succeeded system has made impossible (probability exactly zero) from still reporting the products of its failed systems: the cut-set projection drops the complemented systems, so their weight reaches the truncation only through this bound.

apply_zbdd_filters_et

rust
fn apply_zbdd_filters_et(zbdd: &mut praxis::algorithms::zbdd_engine::ZbddEngine, root: praxis::algorithms::zbdd_engine::ZbddRef, limit_order: Option<usize>, cut_off: Option<f64>) -> praxis::algorithms::zbdd_engine::ZbddRef

compute_approx_et

rust
fn compute_approx_et(zbdd: &praxis::algorithms::zbdd_engine::ZbddEngine, root: praxis::algorithms::zbdd_engine::ZbddRef, approximation: Option<crate::cli::args::Approximation>) -> f64

build_sequence_bdd_for

rust
fn build_sequence_bdd_for(pdag: &mut praxis::algorithms::pdag::Pdag, event_probs: &std::collections::HashMap<String, f64>, seq_id: &str, sequence_root: praxis::algorithms::pdag::NodeIndex, success_roots: &[praxis::algorithms::pdag::NodeIndex]) -> Result<SequenceBdd, Box<dyn std::error::Error>>

Build one sequence's BDD, together with the BDDs of the systems it succeeded so that delete-term can subtract their cut sets afterwards. success_roots is empty unless delete-term is on, in which case the sequence formula holds only the failed systems and each succeeded system deletes the products that contain its cut sets.

analytic_zbdd_wf1_no_approx_no_limits

rust
fn analytic_zbdd_wf1_no_approx_no_limits(cli: &crate::cli::args::Args, model: &praxis::core::model::Model, event_tree: &praxis::core::event_tree::EventTree, event_tree_library: &std::collections::HashMap<String, praxis::core::event_tree::EventTree>, _ie: &praxis::core::event_tree::InitiatingEvent, ie_frequency: f64, _verbose: bool) -> Result<Vec<praxis::io::reporter::EventTreeAnalyticSequence>, Box<dyn std::error::Error>>

analytic_zbdd_wf2_approx_no_limits

rust
fn analytic_zbdd_wf2_approx_no_limits(cli: &crate::cli::args::Args, model: &praxis::core::model::Model, event_tree: &praxis::core::event_tree::EventTree, event_tree_library: &std::collections::HashMap<String, praxis::core::event_tree::EventTree>, _ie: &praxis::core::event_tree::InitiatingEvent, ie_frequency: f64, _verbose: bool) -> Result<Vec<praxis::io::reporter::EventTreeAnalyticSequence>, Box<dyn std::error::Error>>

analytic_zbdd_wf3_no_approx_limits

rust
fn analytic_zbdd_wf3_no_approx_limits(cli: &crate::cli::args::Args, model: &praxis::core::model::Model, event_tree: &praxis::core::event_tree::EventTree, event_tree_library: &std::collections::HashMap<String, praxis::core::event_tree::EventTree>, _ie: &praxis::core::event_tree::InitiatingEvent, ie_frequency: f64, verbose: bool) -> Result<Vec<praxis::io::reporter::EventTreeAnalyticSequence>, Box<dyn std::error::Error>>

analytic_zbdd_wf4_approx_limits

rust
fn analytic_zbdd_wf4_approx_limits(cli: &crate::cli::args::Args, model: &praxis::core::model::Model, event_tree: &praxis::core::event_tree::EventTree, event_tree_library: &std::collections::HashMap<String, praxis::core::event_tree::EventTree>, _ie: &praxis::core::event_tree::InitiatingEvent, ie_frequency: f64, _verbose: bool) -> Result<Vec<praxis::io::reporter::EventTreeAnalyticSequence>, Box<dyn std::error::Error>>

run_monte_carlo_impl

rust
fn run_monte_carlo_impl(cli: &crate::cli::args::Args, model: praxis::core::model::Model, initiating_events: Vec<praxis::core::event_tree::InitiatingEvent>, event_trees: Vec<praxis::core::event_tree::EventTree>, event_tree_library: std::collections::HashMap<String, praxis::core::event_tree::EventTree>, verbose: bool) -> Result<(), Box<dyn std::error::Error>>

run_monte_carlo_from_parsed

rust
fn run_monte_carlo_from_parsed(cli: &crate::cli::args::Args, parsed: &praxis::io::event_tree_parser::EventTreeModel, verbose: bool) -> Result<(), Box<dyn std::error::Error>>

run_analytic_impl

rust
fn run_analytic_impl(cli: &crate::cli::args::Args, model: praxis::core::model::Model, initiating_events: Vec<praxis::core::event_tree::InitiatingEvent>, event_trees: Vec<praxis::core::event_tree::EventTree>, event_tree_library: std::collections::HashMap<String, praxis::core::event_tree::EventTree>, algorithm: crate::cli::args::Algorithm, verbose: bool) -> Result<(), Box<dyn std::error::Error>>

run_analytic_from_parsed

rust
fn run_analytic_from_parsed(cli: &crate::cli::args::Args, parsed: &praxis::io::event_tree_parser::EventTreeModel, algorithm: crate::cli::args::Algorithm, verbose: bool) -> Result<(), Box<dyn std::error::Error>>

select_event_trees_to_run

rust
fn select_event_trees_to_run(initiating_events: &[praxis::core::event_tree::InitiatingEvent], event_trees: &[praxis::core::event_tree::EventTree]) -> Result<Vec<(praxis::core::event_tree::InitiatingEvent, praxis::core::event_tree::EventTree)>, Box<dyn std::error::Error>>

Type Aliases

ParsedModelWithLibs

rust
type ParsedModelWithLibs = (praxis::core::model::Model, Vec<praxis::core::event_tree::InitiatingEvent>, Vec<praxis::core::event_tree::EventTree>, std::collections::HashMap<String, praxis::core::event_tree::EventTree>);