|
ADS-IDAC Engine 5.0.0
|
Namespaces | |
| namespace | xml |
Classes | |
| class | FaultTree |
| A fault tree: nodes keyed by name, plus a designated top event. More... | |
| class | FaultTreeError |
Exception type of the fault tree model, the .fta reader and the quantifier. More... | |
| struct | Node |
| One fault tree node: a basic event or a gate, identified by name. More... | |
| class | Quantifier |
| Exact fault tree quantifier backed by a BNCore junction tree. More... | |
Enumerations | |
| enum class | GateType { Basic , And , Or , KofN , Not } |
| Kind of a fault tree node: a basic event or one of four gate types. More... | |
Functions | |
| FaultTree | parseFtaString (const std::string &text) |
Parses .fta content held in memory. More... | |
| FaultTree | parseFtaFile (const std::string &path) |
Parses a .fta file from disk. More... | |
Variables | |
| constexpr std::size_t | kMaxGateInputs = 20 |
| Largest number of inputs a single gate may have. More... | |
|
strong |
Kind of a fault tree node: a basic event or one of four gate types.
The .fta type codes in the enumerator comments are the codes the reader in fta_parser.hpp maps to each value. Codes 2 and 3 map to Basic, and code 4 (transfer gate) maps to And.
Definition at line 48 of file fault_tree.hpp.
| FaultTree faulttree::parseFtaFile | ( | const std::string & | path | ) |
Parses a .fta file from disk.
Reads the whole file and applies the same rules as parseFtaString(). Error messages that refer to the diagram as a whole name the path.
| path | Path of the .fta file. |
| xml::XmlError | if the file cannot be opened or is not well formed. |
| FaultTreeError | for the model problems listed at parseFtaString(). |
Definition at line 162 of file fta_parser.cpp.
References faulttree::xml::parseFile().
| FaultTree faulttree::parseFtaString | ( | const std::string & | text | ) |
Parses .fta content held in memory.
The root element must be <ftaDiagram>. Every <ftaNode> child of the root is read recursively, and the <ftaNode> elements nested inside a gate are that gate's inputs, in document order. The reader applies these rules:
name attribute of the node's <node> child. An <ftaNode> whose name is already defined adds nothing; the enclosing gate references the existing node.<ftaNode> without an id attribute is skipped.failureProbability attribute (0 when the attribute is absent), read with std::stod. Characters after the number, other than whitespace, are an error.ref attribute of its <transferUpFTADiagram> child.Node::k is the integer value of the k attribute, or 0 when the attribute is absent or empty.<ftaNode> under the root that yields a node. Later root-level nodes are subtrees that transfer gates refer to.A gate is added to the tree after the inputs nested inside it, so FaultTree::nodes() lists inputs before the gate that first contains them.
| text | Complete .fta XML document. |
| xml::XmlError | if the text is not well formed within the XML subset xml_lite.hpp accepts. |
| FaultTreeError | if the root is not <ftaDiagram>, an <ftaNode> lacks its <node> child or a non-empty name, the type attribute is absent or not one of 0 to 7, a basic event has a <linkedBBN> child, a failureProbability or k value is malformed or out of range for its numeric type, a transfer gate has no reference or an empty one, the diagram yields no top node, or FaultTree::validate() rejects the result. |
Definition at line 158 of file fta_parser.cpp.
References faulttree::xml::parse().
|
inlineconstexpr |
Largest number of inputs a single gate may have.
Gates wider than this would need a conditional table of 2^(n+1) doubles, which is a modelling error rather than something to allocate.
Definition at line 44 of file quantifier.hpp.
Referenced by faulttree::Quantifier::build().