11DftModule::DftModule(
size_t representative, std::set<size_t>
const& elements) : representative(representative), elements(elements) {
17template<
typename ValueType>
19 std::stringstream stream;
35 bool staticElements,
bool fullyStatic,
bool singleBE)
36 :
DftModule(representative, elements), staticElements(staticElements), fullyStatic(fullyStatic), singleBE(singleBE), submodules(submodules) {
38 "Representative " + std::to_string(
representative) +
" must be contained in module.");
43 std::set<size_t> allElements =
elements;
44 for (
auto const& submodule : submodules) {
45 allElements.merge(submodule.getAllElements());
50template<
typename ValueType>
53 std::unordered_set<std::string> depInConflict;
59 depInConflict.insert(tmpElement->name());
63 auto subdft = builder.
build();
65 for (
size_t id : subdft.getDependencies()) {
67 if (depInConflict.find(subdft.getElement(
id)->name()) == depInConflict.end()) {
68 subdft.setDependencyNotInConflict(
id);
74template<
typename ValueType>
76 std::stringstream stream;
78 std::string subIndentation = indentation +
" ";
80 stream <<
"\n" << subIndentation <<
"Sub-module " << submodule.toString(dft, subIndentation);
storm::dft::storage::DFT< ValueType > build()
Create DFT.
void cloneElement(DFTElementCPointer element)
Clone element and add it via the builder.
void setTopLevel(std::string const &tle)
Set top level element.
Represents a Dynamic Fault Tree.
DFTElementCPointer getElement(size_t index) const
Get a pointer to an element in the DFT.
bool isDependencyInConflict(size_t id) const
Represents an independent module/subtree.
DftIndependentModule(size_t representative, std::set< size_t > const &elements, std::set< DftIndependentModule > const &submodules, bool staticElements, bool fullyStatic, bool singleBE)
Constructor.
std::string toString(storm::dft::storage::DFT< ValueType > const &dft, std::string const &indentation="") const
Get string representation of module.
std::set< size_t > getAllElements() const
Returns all elements contained in the module (including sub-modules).
storm::dft::storage::DFT< ValueType > getSubtree(storm::dft::storage::DFT< ValueType > const &dft) const
Create subtree corresponding to module.
Represents a module/subtree in a DFT.
std::set< size_t > elements
size_t getRepresentative() const
Get representative (top element of subtree).
DftModule(size_t representative, std::set< size_t > const &elements)
Constructor.
std::string toString(storm::dft::storage::DFT< ValueType > const &dft) const
Get string representation of module.
#define STORM_LOG_ASSERT(cond, message)