TeDDy 4.1.0
Decision diagram library.
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
teddy::reliability_manager< Degree, Domain > Class Template Reference

Base class for reliability managers. More...

#include <reliability_manager.hpp>

Inheritance diagram for teddy::reliability_manager< Degree, Domain >:
teddy::diagram_manager< double, Degree, Domain >

Public Types

using diagram_t = typename diagram_manager< double, Degree, Domain >::diagram_t
 
- Public Types inherited from teddy::diagram_manager< double, Degree, Domain >
using diagram_t = diagram< double, Degree >
 Alias for the diagram type used in the functions of this manager.
 

Public Member Functions

template<probs::prob_vector Ps>
requires (details::is_bss<Degree>)
auto calculate_probabilities (Ps const &probs, diagram_t const &diagram) -> void
 Calculates probabilities of system states 0 and 1.
 
template<probs::prob_matrix Ps>
auto calculate_probabilities (Ps const &probs, diagram_t const &diagram) -> void
 Calculates probabilities of all system states.
 
template<probs::prob_vector Ps>
requires (details::is_bss<Degree>)
auto calculate_probability (Ps const &probs, diagram_t const &diagram) -> double
 Calculates and returns probability of system state 1.
 
template<probs::prob_matrix Ps>
auto calculate_probability (int32 state, Ps const &probs, diagram_t const &diagram) -> double
 Calculates and returns probability of a system state state.
 
auto get_probability (int32 state) const -> double
 Returns probability of given system state.
 
template<probs::prob_vector Ps, class Foo = void>
requires (details::is_bss<Degree>)
auto calculate_availability (Ps const &probs, diagram_t const &diagram) -> utils::second_t< Foo, double >
 Calculates and returns availability of a BSS.
 
template<probs::prob_matrix Ps>
auto calculate_availability (int32 state, Ps const &probs, diagram_t const &diagram) -> double
 Calculates and returns system availability with respect to the system state state.
 
template<class Foo = void>
requires (details::is_bss<Degree>)
auto get_availability () const -> utils::second_t< Foo, double >
 Returns availability of a BSS.
 
auto get_availability (int32 state) const -> double
 Returns system availability with respect to the system state state.
 
template<probs::prob_matrix Ps, class Foo = void>
requires (details::is_bss<Degree>)
auto calculate_unavailability (Ps const &probs, diagram_t const &diagram) -> utils::second_t< Foo, double >
 Calculates and returns unavailability of a BSS.
 
template<probs::prob_matrix Ps>
auto calculate_unavailability (int32 state, Ps const &probs, diagram_t const &diagram) -> double
 Calculates and returns system availability with respect to the system state state.
 
template<class Foo = void>
requires (details::is_bss<Degree>)
auto get_unavailability () -> utils::second_t< Foo, double >
 Returns system unavailability of a BSS.
 
auto get_unavailability (int32 state) -> double
 Returns system unavailability with respect to the system state state.
 
auto state_frequency (diagram_t const &diagram, int32 state) -> double
 Returns system state frequency of state state.
 
template<class FChange >
auto dpld (var_change varChange, FChange fChange, diagram_t const &diagram) -> diagram_t
 Calculates Direct Partial Boolean Derivative.
 
auto to_dpld_e (int32 varFrom, int32 varIndex, diagram_t const &dpld) -> diagram_t
 Transforms dpld into Extended DPLD.
 
auto structural_importance (diagram_t const &dpld) -> double
 Calculates Structural Importace (SI) of a component.
 
template<probs::prob_matrix Ps>
auto birnbaum_importance (Ps const &probs, diagram_t const &dpld) -> double
 Calculates Birnbaum importance (BI) of a component.
 
template<probs::prob_matrix Ps>
auto fussell_vesely_importance (Ps const &probs, diagram_t const &dpld, double unavailability, int32 componentState, int32 componentIndex) -> double
 Calculates Fussell-Vesely importance (FVI) of a component.
 
template<out_var_values Vars>
auto mcvs (diagram_t const &diagram, int32 state) -> std::vector< Vars >
 Finds all Minimal Cut Vector (MCVs) of the system with respect to the system state State.
 
template<out_var_values Vars>
auto mpvs (diagram_t const &diagram, int32 state) -> std::vector< Vars >
 Finds all Minimal Path Vector (MPVs) of the system with respect to the system state state.
 
template<out_var_values Vars, std::output_iterator< Vars > Out>
auto mcvs_g (diagram_t const &diagram, int32 state, Out out) -> void
 Finds all Minimal Cut Vector of the system with respect to the system state state.
 
template<out_var_values Vars, std::output_iterator< Vars > Out>
auto mpvs_g (diagram_t const &diagram, int32 state, Out out) -> void
 Finds all Minimal Path Vector (MPVs) of the system with respect to the system state state.
 
- Public Member Functions inherited from teddy::diagram_manager< double, Degree, Domain >
auto constant (int32 val) -> diagram_t
 Creates diagram representing constant function.
 
auto variable (int32 index) -> diagram_t
 Creates diagram representing function of single variable.
 
auto variable_not (int32 index) -> utils::second_t< Foo, diagram_t >
 Creates BDD representing function of complemented variable.
 
auto operator() (int32 index) -> diagram_t
 Creates diagram representing function of single variable.
 
auto variables (std::initializer_list< T > indices) -> std::vector< diagram_t >
 Creates vector of diagrams representing single variables.
 
auto variables (I first, S last) -> std::vector< diagram_t >
 Creates vector of diagrams representing functions of single variables.
 
auto variables (Is const &indices) -> std::vector< diagram_t >
 Creates vector of diagrams representing single variables.
 
auto from_vector (I first, S last) -> diagram_t
 Creates diagram from a truth vector of a function.
 
auto from_vector (R &&vector) -> diagram_t
 Creates diagram from a truth vector of a function.
 
auto to_vector (diagram_t const &diagram) const -> std::vector< int32 >
 Creates truth vector from the diagram.
 
auto to_vector_g (diagram_t const &diagram, O out) const -> void
 Creates truth vector from the diagram.
 
auto from_pla (pla_file const &file, fold_type foldType=fold_type::Tree) -> utils::second_t< Foo, std::vector< diagram_t > >
 Creates BDDs defined by PLA file.
 
auto from_expression_tree (Node const &root) -> diagram_t
 Creates diagram from an expression tree (AST).
 
auto apply (diagram_t const &lhs, diagram_t const &rhs) -> diagram_t
 Merges two diagrams using given binary operation.
 
auto apply_n (Diagram const &... diagrams) -> diagram_t
 TODO.
 
auto left_fold (R const &diagrams) -> diagram_t
 Merges diagams in the range using the apply function and binary operation.
 
auto left_fold (I first, S last) -> diagram_t
 Merges diagams in the range using the apply function and binary operation.
 
auto tree_fold (R &diagrams) -> diagram_t
 Merges diagams in the range using the apply function and binary operation.
 
auto tree_fold (I first, S last) -> diagram_t
 Merges diagams in the range using the apply function and binary operation.
 
auto evaluate (diagram_t const &diagram, Vars const &values) const -> int32
 Evaluates value of the function represented by the diagram.
 
auto satisfy_count (int32 value, diagram_t const &diagram) -> int64
 Calculates number of variable assignments for which the functions evaluates to certain value.
 
auto satisfy_one (int32 value, diagram_t const &diagram) -> std::optional< Vars >
 Finds variable assignment for which diagram evaluates to value.
 
auto satisfy_all (int32 value, diagram_t const &diagram) const -> std::vector< Vars >
 Enumerates all elements of the satisfying set.
 
auto satisfy_all_g (int32 value, diagram_t const &diagram, O out) const -> void
 Enumerates all elements of the satisfying set.
 
auto satisfy_all_g (int32 const value, diagram_t const &diagram, OutputIt out) const -> void
 
auto get_cofactor (diagram_t const &diagram, int32 varIndex, int32 varValue) -> diagram_t
 Calculates cofactor of the functions.
 
auto get_cofactor (diagram_t const &diagram, std::vector< var_cofactor > const &vars) -> diagram_t
 
auto transform (diagram_t const &diagram, F transformer) -> diagram_t
 Transforms values of the function.
 
auto negate (diagram_t const &diagram) -> utils::second_t< Foo, diagram_t >
 Negates Boolean function.
 
auto get_dependency_set (diagram_t const &diagram) const -> std::vector< int32 >
 Enumerates indices of variables that the function depends on.
 
auto get_dependency_set_g (diagram_t const &diagram, O out) const -> void
 Enumerates indices of variables that the function depends on.
 
auto reduce (diagram_t const &diagram) -> diagram_t
 Reduces diagrams to its canonical form.
 
auto get_node_count () const -> int64
 Returns number of nodes that are currently used by the manager.
 
auto get_node_count (diagram_t const &diagram) const -> int64
 Returns number of nodes in the diagram including terminal nodes.
 
auto to_dot_graph (std::ostream &out) const -> void
 Prints dot representation of the graph.
 
auto to_dot_graph (std::ostream &out, diagram_t const &diagram) const -> void
 Prints dot representation of the diagram.
 
auto force_gc () -> void
 Runs garbage collection.
 
auto force_reorder () -> void
 Runs variable reordering heuristic.
 
auto clear_cache () -> void
 Clears apply cache.
 
auto get_var_count () const -> int32
 Returns number of variables for this manager set in the constructor.
 
auto get_order () const -> std::vector< int32 > const &
 Returns current order of variables.
 
auto get_domains () const -> std::vector< int32 >
 Return domains of variables.
 
auto set_cache_ratio (double ratio) -> void
 Sets the relative cache size w.r.t the number of nodes.
 
auto set_gc_ratio (double ratio) -> void
 Sets ratio used to determine new node pool allocation.
 
auto set_auto_reorder (bool doReorder) -> void
 Enables or disables automatic variable reordering.
 
 diagram_manager (diagram_manager &&) noexcept=default
 
 diagram_manager (diagram_manager const &)=delete
 
auto operator= (diagram_manager &&) noexcept -> diagram_manager &=default
 
auto operator= (diagram_manager const &) -> diagram_manager &=delete
 

Protected Member Functions

 reliability_manager (int32 varCount, int64 nodePoolSize, int64 overflowNodePoolSize, std::vector< int32 > order)
 
 reliability_manager (int32 varCount, int64 nodePoolSize, int64 overflowNodePoolSize, domains::mixed domain, std::vector< int32 > order)
 
- Protected Member Functions inherited from teddy::diagram_manager< double, Degree, Domain >
 diagram_manager (int32 varCount, int64 nodePoolSize, int64 extraNodePoolSize, std::vector< int32 > order)
 Initializes diagram manager.
 
 diagram_manager (int32 varCount, int64 nodePoolSize, int64 extraNodePoolSize, domains::mixed domain, std::vector< int32 > order)
 Initializes diagram manager.
 

Additional Inherited Members

- Protected Types inherited from teddy::diagram_manager< double, Degree, Domain >
using node_t = typename diagram< double, Degree >::node_t
 
using son_container = typename node_t::son_container
 
- Protected Attributes inherited from teddy::diagram_manager< double, Degree, Domain >
node_manager< double, Degree, Domain > nodes_
 

Detailed Description

template<class Degree, class Domain>
class teddy::reliability_manager< Degree, Domain >

Base class for reliability managers.

Base class for reliability managers. Defines all functions for reliability analysis.

Member Function Documentation

◆ calculate_probabilities() [1/2]

template<class Degree , class Domain >
requires (details::is_bss<Degree>)
template<probs::prob_matrix Ps>
requires (details::is_bss<Degree>)
auto teddy::reliability_manager< Degree, Domain >::calculate_probabilities ( Ps const &  probs,
diagram_t const &  diagram 
) -> void

Calculates probabilities of system states 0 and 1.

probs[i] must return probability that i-th component is in state 1 After a call to this method you can acces individual system state probabilities using get_probability method.

Template Parameters
Typethat holds component state probabilities
Parameters
probsvector of component state probabilities
diagramStructure function

◆ calculate_probabilities() [2/2]

template<class Degree , class Domain >
template<probs::prob_matrix Ps>
auto teddy::reliability_manager< Degree, Domain >::calculate_probabilities ( Ps const &  probs,
diagram_t const &  diagram 
) -> void

Calculates probabilities of all system states.

probs[i][k] must return probability that i-th component is in state k After a call to this method you can acces individual system state probabilities using get_probability method.

Template Parameters
Typethat holds component state probabilities
Parameters
probsmatrix of component state probabilities
diagramStructure function

◆ calculate_probability() [1/2]

template<class Degree , class Domain >
requires (details::is_bss<Degree>)
template<probs::prob_vector Ps>
requires (details::is_bss<Degree>)
auto teddy::reliability_manager< Degree, Domain >::calculate_probability ( Ps const &  probs,
diagram_t const &  diagram 
) -> double

Calculates and returns probability of system state 1.

probs[i] must return probability that i-th component is in state 1

Template Parameters
Typethat holds component state probabilities
Parameters
probsvector of component state probabilities
diagramStructure function
Returns
Probability that system described by diagram is in state 1 given probabilities probs

◆ calculate_probability() [2/2]

template<class Degree , class Domain >
template<probs::prob_matrix Ps>
auto teddy::reliability_manager< Degree, Domain >::calculate_probability ( int32  state,
Ps const &  probs,
diagram_t const &  diagram 
) -> double

Calculates and returns probability of a system state state.

probs[i][k] must return probability that i-th component is in state k

Template Parameters
Typethat holds component state probabilities
Parameters
stateSystem state
probsmatrix of component state probabilities
diagramStructure function
Returns
Probability that system described by diagran is in state state given probabilities probs

◆ get_probability()

template<class Degree , class Domain >
auto teddy::reliability_manager< Degree, Domain >::get_probability ( int32  state) const -> double

Returns probability of given system state.

Call to calculate_probabilities must proceed call to this funtion otherwise the result is undefined. This is a bit unfortunate but the idea is that probabilities are calculated once using calculate_probabilities and later accessed using get_probability

Parameters
stateSystem state
Returns
Probability of a system state state

◆ calculate_availability() [1/2]

template<class Degree , class Domain >
requires (details::is_bss<Degree>)
template<probs::prob_vector Ps, class Foo >
requires (details::is_bss<Degree>)
auto teddy::reliability_manager< Degree, Domain >::calculate_availability ( Ps const &  probs,
diagram_t const &  diagram 
) -> utils::second_t<Foo, double>

Calculates and returns availability of a BSS.

probs[i] must return probability that i-th component is in state 1

Template Parameters
Componentstate probabilities
FooDummy parameter to enable SFINE
Parameters
probsvector of component state probabilities
diagramStructure function
Returns
System availability

◆ calculate_availability() [2/2]

template<class Degree , class Domain >
template<probs::prob_matrix Ps>
auto teddy::reliability_manager< Degree, Domain >::calculate_availability ( int32  state,
Ps const &  probs,
diagram_t const &  diagram 
) -> double

Calculates and returns system availability with respect to the system state state.

probs[i][k] must return probability that i-th component is in state k

Template Parameters
Componentstate probabilities
Parameters
stateSystem state
probsmatrix of component state probabilities
diagramStructure function
Returns
System availability with respect to the system state state

◆ get_availability() [1/2]

template<class Degree , class Domain >
requires (details::is_bss<Degree>)
template<class Foo >
requires (details::is_bss<Degree>)
auto teddy::reliability_manager< Degree, Domain >::get_availability

Returns availability of a BSS.

Call to calculate_probabilities must proceed call to this funtion otherwise the result is undefined. This is a bit unfortunate but the idea is that probabilities are calculated once using calculate_probabilities and availability and unavailability are later accessed using get_availability and get_unavailability

Returns
System availability

◆ get_availability() [2/2]

template<class Degree , class Domain >
auto teddy::reliability_manager< Degree, Domain >::get_availability ( int32  state) const -> double

Returns system availability with respect to the system state state.

Call to calculate_probabilities must proceed call to this funtion otherwise the result is undefined. This is a bit unfortunate but the idea is that probabilities are calculated once using calculate_probabilities and availability and unavailability are later accessed using get_availability and get_unavailability

Parameters
stateSystem state
Returns
System availability with respect to the system state state

◆ calculate_unavailability() [1/2]

template<class Degree , class Domain >
requires (details::is_bss<Degree>)
template<probs::prob_matrix Ps, class Foo >
requires (details::is_bss<Degree>)
auto teddy::reliability_manager< Degree, Domain >::calculate_unavailability ( Ps const &  probs,
diagram_t const &  diagram 
) -> utils::second_t<Foo, double>

Calculates and returns unavailability of a BSS.

probs[i] must return probability that i-th component is in state 1

Template Parameters
Componentstate probabilities
FooDummy parameter to enable SFINE
Parameters
probsvector of component state probabilities
diagranStructure function
Returns
System unavailtability

◆ calculate_unavailability() [2/2]

template<class Degree , class Domain >
template<probs::prob_matrix Ps>
auto teddy::reliability_manager< Degree, Domain >::calculate_unavailability ( int32  state,
Ps const &  probs,
diagram_t const &  diagram 
) -> double

Calculates and returns system availability with respect to the system state state.

probs[i][k] must return probability that i-th component is in state k

Template Parameters
Componentstate probabilities
Parameters
stateSystem state
probsmatrix of component state probabilities
diagramStructure function
Returns
System availability with respect to the system state state

◆ get_unavailability() [1/2]

template<class Degree , class Domain >
requires (details::is_bss<Degree>)
template<class Foo >
requires (details::is_bss<Degree>)
auto teddy::reliability_manager< Degree, Domain >::get_unavailability

Returns system unavailability of a BSS.

Call to calculate_probabilities must proceed call to this funtion otherwise the result is undefined. This is a bit unfortunate but the idea is that probabilities are calculated once using calculate_probabilities and availability and unavailability are later accessed using get_availability and get_unavailability

Returns
System availability

◆ get_unavailability() [2/2]

template<class Degree , class Domain >
auto teddy::reliability_manager< Degree, Domain >::get_unavailability ( int32  state) -> double

Returns system unavailability with respect to the system state state.

Call to calculate_probabilities must proceed call to this funtion otherwise the result is undefined. This is a bit unfortunate but the idea is that probabilities are calculated once using calculate_probabilities and availability and unavailability are later accessed using get_availability and get_unavailability

Parameters
stateSystem state
Returns
System unavailability with respect to the system state state

◆ state_frequency()

template<class Degree , class Domain >
auto teddy::reliability_manager< Degree, Domain >::state_frequency ( diagram_t const &  diagram,
int32  state 
) -> double

Returns system state frequency of state state.

Parameters
diagramStructure function
stateSystem state
Returns
Frequency of system state state

◆ dpld()

template<class Degree , class Domain >
template<class FChange >
auto teddy::reliability_manager< Degree, Domain >::dpld ( var_change  varChange,
FChange  fChange,
diagram_t const &  diagram 
) -> diagram_t

Calculates Direct Partial Boolean Derivative.

Parameters
varChangeChange of the value of a variable
fChangeChange of the value of the system
diagramStructure function
Returns
Diagram representing Direct Partial Boolean Derivative

◆ to_dpld_e()

template<class Degree , class Domain >
auto teddy::reliability_manager< Degree, Domain >::to_dpld_e ( int32  varFrom,
int32  varIndex,
diagram_t const &  dpld 
) -> diagram_t

Transforms dpld into Extended DPLD.

Parameters
varFromValue from whitch the variable changes
varIndexIndex of the variable
varFromDerivative
Returns
Diagram representing Extended DPLD

◆ structural_importance()

template<class Degree , class Domain >
auto teddy::reliability_manager< Degree, Domain >::structural_importance ( diagram_t const &  dpld) -> double

Calculates Structural Importace (SI) of a component.

Different types of DPLDs can be used for the calculation. It is up to the user to pick the one that suits his needs.

Parameters
dpldDirect Partial Boolean Derivative of any type
Returns
Structural importance of the component

◆ birnbaum_importance()

template<class Degree , class Domain >
template<probs::prob_matrix Ps>
auto teddy::reliability_manager< Degree, Domain >::birnbaum_importance ( Ps const &  probs,
diagram_t const &  dpld 
) -> double

Calculates Birnbaum importance (BI) of a component.

Different types of DPLDs can be used for the calculation. It is up to the user to pick the one that suits his needs.

Parameters
probsComponent state probabilities
dpldDirect Partial Boolean Derivative of any type
Returns
Birnbaum importance of the component

◆ fussell_vesely_importance()

template<class Degree , class Domain >
template<probs::prob_matrix Ps>
auto teddy::reliability_manager< Degree, Domain >::fussell_vesely_importance ( Ps const &  probs,
diagram_t const &  dpld,
double  unavailability,
int32  componentState,
int32  componentIndex 
) -> double

Calculates Fussell-Vesely importance (FVI) of a component.

Different types of DPLDs can be used for the calculation. It is up to the user to pick the one that suits his needs.

Parameters
probsComponent state probabilities
dpldDirect Partial Boolean Derivative of any type
unavailabilitySystem unavailability
componentStateState of the component
componentIndexComponent index
Returns
Fussell-Vesely of the component

◆ mcvs()

template<class Degree , class Domain >
template<out_var_values Vars>
auto teddy::reliability_manager< Degree, Domain >::mcvs ( diagram_t const &  diagram,
int32  state 
) -> std::vector<Vars>

Finds all Minimal Cut Vector (MCVs) of the system with respect to the system state State.

This function uses satisfy_all function. Please keep in mind that for bigger systems, there can be a huge number of MCVs.

Template Parameters
VarsContainer type that defines operator[] and allows assigning integers e.g std::vector or std::array
Parameters
diagramStructure function
stateSystem state
Returns
Vector of Minimal Cut Vectors

◆ mpvs()

template<class Degree , class Domain >
template<out_var_values Vars>
auto teddy::reliability_manager< Degree, Domain >::mpvs ( diagram_t const &  diagram,
int32  state 
) -> std::vector<Vars>

Finds all Minimal Path Vector (MPVs) of the system with respect to the system state state.

This function uses satisfy_all function. Please keep in mind that for bigger systems, there can be a huge number of MCVs

Template Parameters
VarsContainer type that defines operator[] and allows assigning integers e.g std::vector or std::array
Parameters
diagramStructure function
stateSystem state
Returns
Vector of Minimal Cut Vectors.

◆ mcvs_g()

template<class Degree , class Domain >
template<out_var_values Vars, std::output_iterator< Vars > Out>
auto teddy::reliability_manager< Degree, Domain >::mcvs_g ( diagram_t const &  diagram,
int32  state,
Out  out 
) -> void

Finds all Minimal Cut Vector of the system with respect to the system state state.

This function uses satisfy_all_g function. Please keep in mind that for bigger systems, there can be a huge number of MCVs.

Template Parameters
VarsContainer type that defines operator[] and allows assigning integers e.g std::vector or std::array
Parameters
diagramStructure function
stateSystem state
outOutput iterator that is used to output instances of Vars

◆ mpvs_g()

template<class Degree , class Domain >
template<out_var_values Vars, std::output_iterator< Vars > Out>
auto teddy::reliability_manager< Degree, Domain >::mpvs_g ( diagram_t const &  diagram,
int32  state,
Out  out 
) -> void

Finds all Minimal Path Vector (MPVs) of the system with respect to the system state state.

This function uses satisfy_all function. Please keep in mind that for bigger systems, there can be a huge number of MCVs

Template Parameters
VarsContainer type that defines operator[] and allows assigning integers e.g std::vector or std::array
Parameters
diagramStructure function
stateSystem state
outOutput iterator that is used to output instances of Vars .

The documentation for this class was generated from the following file: