Storm
A Modern Probabilistic Model Checker
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DftModule.h
Go to the documentation of this file.
1#pragma once
2
3#include <set>
4#include <string>
5
7
8namespace storm::dft {
9namespace storage {
10
11// Forward declaration
12template<typename ValueType>
13class DFT;
14
18class DftModule {
19 public:
25 DftModule(size_t representative, std::set<size_t> const& elements);
26
31 size_t getRepresentative() const {
32 return representative;
33 }
34
39 std::set<size_t> const& getElements() const {
40 return elements;
41 }
42
46 void clear() {
47 elements.clear();
48 }
49
55 template<typename ValueType>
56 std::string toString(storm::dft::storage::DFT<ValueType> const& dft) const;
57
58 protected:
60 std::set<size_t> elements;
61};
62
67 public:
77 DftIndependentModule(size_t representative, std::set<size_t> const& elements, std::set<DftIndependentModule> const& submodules, bool staticElements,
78 bool fullyStatic, bool singleBE);
79
85 bool isStatic() const {
86 return staticElements;
87 }
88
93 bool isFullyStatic() const {
94 return fullyStatic;
95 }
96
101 std::set<DftIndependentModule> const& getSubModules() const {
102 return submodules;
103 }
104
109 bool isSingleBE() const {
110 return singleBE;
111 }
112
117 std::set<size_t> getAllElements() const;
118
124 template<typename ValueType>
126
133 template<typename ValueType>
134 std::string toString(storm::dft::storage::DFT<ValueType> const& dft, std::string const& indentation = "") const;
135
136 bool operator<(DftIndependentModule const& other) const {
137 return this->getRepresentative() < other.getRepresentative();
138 }
139
140 private:
141 bool staticElements;
142 bool fullyStatic;
143 bool singleBE;
144 std::set<DftIndependentModule> submodules;
145};
146
147} // namespace storage
148} // namespace storm::dft
Represents a Dynamic Fault Tree.
Definition DFT.h:52
Represents an independent module/subtree.
Definition DftModule.h:66
std::string toString(storm::dft::storage::DFT< ValueType > const &dft, std::string const &indentation="") const
Get string representation of module.
Definition DftModule.cpp:75
std::set< size_t > getAllElements() const
Returns all elements contained in the module (including sub-modules).
Definition DftModule.cpp:42
bool isStatic() const
Returns whether the module contains only static elements (except in sub-modules).
Definition DftModule.h:85
bool isSingleBE() const
Returns whether the module is a single BE, i.e., a trivial module.
Definition DftModule.h:109
bool operator<(DftIndependentModule const &other) const
Definition DftModule.h:136
storm::dft::storage::DFT< ValueType > getSubtree(storm::dft::storage::DFT< ValueType > const &dft) const
Create subtree corresponding to module.
Definition DftModule.cpp:51
bool isFullyStatic() const
Returns whether the module contains only static elements (also in sub-modules).
Definition DftModule.h:93
std::set< DftIndependentModule > const & getSubModules() const
Returns sub-modules.
Definition DftModule.h:101
Represents a module/subtree in a DFT.
Definition DftModule.h:18
std::set< size_t > const & getElements() const
Return elements of module.
Definition DftModule.h:39
void clear()
Clear list of elements.
Definition DftModule.h:46
std::set< size_t > elements
Definition DftModule.h:60
size_t getRepresentative() const
Get representative (top element of subtree).
Definition DftModule.h:31
std::string toString(storm::dft::storage::DFT< ValueType > const &dft) const
Get string representation of module.
Definition DftModule.cpp:18