10DftModule::DftModule(
size_t representative, std::set<size_t>
const& elements) : representative(representative), elements(elements) {
16template<
typename ValueType>
18 std::stringstream stream;
34 bool staticElements,
bool fullyStatic,
bool singleBE)
35 :
DftModule(representative, elements), staticElements(staticElements), fullyStatic(fullyStatic), singleBE(singleBE), submodules(submodules) {
37 "Representative " + std::to_string(
representative) +
" must be contained in module.");
42 std::set<size_t> allElements =
elements;
43 for (
auto const& submodule : submodules) {
44 allElements.merge(submodule.getAllElements());
49template<
typename ValueType>
52 std::unordered_set<std::string> depInConflict;
58 depInConflict.insert(tmpElement->name());
62 auto subdft = builder.
build();
64 for (
size_t id : subdft.getDependencies()) {
66 if (depInConflict.find(subdft.getElement(
id)->name()) == depInConflict.end()) {
67 subdft.setDependencyNotInConflict(
id);
73template<
typename ValueType>
75 std::stringstream stream;
77 std::string subIndentation = indentation +
" ";
79 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)