praxis_cli / cli / event_tree
Module event_tree
Contents
- Structs
- Functions
parse_model_with_libs_from_parsedevent_names_from_pdagenumerate_cut_sets_ettruncation_scalesequence_below_cut_offapply_zbdd_filters_etcompute_approx_etbuild_sequence_bdd_foranalytic_zbdd_wf1_no_approx_no_limitsanalytic_zbdd_wf2_approx_no_limitsanalytic_zbdd_wf3_no_approx_limitsanalytic_zbdd_wf4_approx_limitsrun_monte_carlo_implrun_monte_carlo_from_parsedrun_analytic_implrun_analytic_from_parsedselect_event_trees_to_run
- Type Aliases
Quick Reference
| Item | Kind | Description |
|---|---|---|
SequenceBdd | struct | |
SequenceIntermediate | struct | |
parse_model_with_libs_from_parsed | fn | |
event_names_from_pdag | fn | |
enumerate_cut_sets_et | fn | |
truncation_scale | fn | The factor folded into every product's value before it meets the cut-off. |
sequence_below_cut_off | fn | Whether no product of this sequence can reach the cut-off. |
apply_zbdd_filters_et | fn | |
compute_approx_et | fn | |
build_sequence_bdd_for | fn | Build 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_limits | fn | |
analytic_zbdd_wf2_approx_no_limits | fn | |
analytic_zbdd_wf3_no_approx_limits | fn | |
analytic_zbdd_wf4_approx_limits | fn | |
run_monte_carlo_impl | fn | |
run_monte_carlo_from_parsed | fn | |
run_analytic_impl | fn | |
run_analytic_from_parsed | fn | |
select_event_trees_to_run | fn | |
ParsedModelWithLibs | type |
Structs
SequenceBdd
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
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
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
fn event_names_from_pdag(pdag: &praxis::algorithms::pdag::Pdag, order: &[praxis::algorithms::pdag::NodeIndex]) -> Vec<Option<String>>enumerate_cut_sets_et
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
fn truncation_scale(basis: crate::cli::args::CutOffBasis, ie_frequency: f64) -> f64The 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
fn sequence_below_cut_off(scale: f64, probability: f64, cut_off: Option<f64>) -> boolWhether 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
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::ZbddRefcompute_approx_et
fn compute_approx_et(zbdd: &praxis::algorithms::zbdd_engine::ZbddEngine, root: praxis::algorithms::zbdd_engine::ZbddRef, approximation: Option<crate::cli::args::Approximation>) -> f64build_sequence_bdd_for
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
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
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
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
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
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
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
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
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
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
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>);