Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
DFTBuilder.cpp
Go to the documentation of this file.
1#include "DFTBuilder.h"
2
3#include <algorithm>
4
9
12
13namespace storm::dft {
14namespace builder {
15
16template<typename ValueType>
17DFTBuilder<ValueType>::DFTBuilder() : mNextId(0), comparator() {
18 // Intentionally left empty
19}
20
21template<>
22DFTBuilder<double>::DFTBuilder() : mNextId(0), comparator(0 /* Set error to 0*/) {
23 // Intentionally left empty
24}
25
26template<typename ValueType>
28 STORM_LOG_THROW(!mTopLevelName.empty(), storm::exceptions::WrongFormatException, "No top level element defined.");
29
30 // Build parent/child connections for gates
31 for (auto& gateChildrenPair : mChildNames) {
32 STORM_LOG_ASSERT(gateChildrenPair.first->isGate(), "Element " << *gateChildrenPair.first << " with children is not a gate.");
33 DFTGatePointer gate = std::static_pointer_cast<storm::dft::storage::elements::DFTGate<ValueType>>(gateChildrenPair.first);
34 for (std::string const& childName : gateChildrenPair.second) {
35 auto itFind = mElements.find(childName);
36 STORM_LOG_THROW(itFind != mElements.end(), storm::exceptions::WrongFormatException,
37 "Child '" << childName << "' for gate '" << gate->name() << "' not found.");
38 DFTElementPointer childElement = itFind->second;
39 if (childElement->isRestriction()) {
40 STORM_LOG_WARN("Restriction '" << childName << "' is ignored as input for gate '" << gate->name() << "', because restrictions have no output.");
41 } else if (childElement->isDependency()) {
42 STORM_LOG_WARN("Dependency '" << childName << "' is ignored as input for gate '" << gate->name() << "', because dependencies have no output.");
43 } else {
44 gate->addChild(childElement);
45 childElement->addParent(gate);
46 }
47 }
48 }
49
50 // Build connections for restrictions
51 for (auto& restrictionChildrenPair : mRestrictionChildNames) {
52 DFTRestrictionPointer restriction = restrictionChildrenPair.first;
53 for (std::string const& childName : restrictionChildrenPair.second) {
54 auto itFind = mElements.find(childName);
55 STORM_LOG_THROW(itFind != mElements.end(), storm::exceptions::WrongFormatException,
56 "Child '" << childName << "' for restriction '" << restriction->name() << "' not found.");
57 DFTElementPointer childElement = itFind->second;
58 STORM_LOG_THROW(childElement->isGate() || childElement->isBasicElement(), storm::exceptions::WrongFormatException,
59 "Child '" << childElement->name() << "' of restriction '" << restriction->name() << "' must be gate or BE.");
60 restriction->addChild(childElement);
61 childElement->addRestriction(restriction);
62 }
63 }
64
65 // Build connections for dependencies
66 for (auto& dependencyChildrenPair : mDependencyChildNames) {
67 DFTDependencyPointer dependency = dependencyChildrenPair.first;
68 bool triggerElement = true;
69 for (std::string const& childName : dependencyChildrenPair.second) {
70 auto itFind = mElements.find(childName);
71 STORM_LOG_THROW(itFind != mElements.end(), storm::exceptions::WrongFormatException,
72 "Child '" << childName << "' for dependency '" << dependency->name() << "' not found.");
73 DFTElementPointer childElement = itFind->second;
74 if (triggerElement) {
75 triggerElement = false;
76 STORM_LOG_THROW(childElement->isGate() || childElement->isBasicElement(), storm::exceptions::WrongFormatException,
77 "Trigger element '" << childName << "' of dependency '" << dependency->name() << "' must be gate or BE.");
78 dependency->setTriggerElement(std::static_pointer_cast<storm::dft::storage::elements::DFTGate<ValueType>>(childElement));
79 childElement->addOutgoingDependency(dependency);
80 } else {
81 STORM_LOG_THROW(childElement->isBasicElement(), storm::exceptions::WrongFormatException,
82 "Dependent element '" << childName << "' of dependency '" << dependency->name() << "' must be BE.");
83 DFTBEPointer dependentBE = std::static_pointer_cast<storm::dft::storage::elements::DFTBE<ValueType>>(childElement);
84 dependency->addDependentEvent(dependentBE);
85 dependentBE->addIngoingDependency(dependency);
86 }
87 }
88 }
89
90 // Sort elements topologically
91 DFTElementVector elements = sortTopological();
92 // Set ids according to order
93 size_t id = 0;
94 for (DFTElementPointer e : elements) {
95 e->setId(id++);
96 }
97 // Compute rank
98 computeRank(mElements[mTopLevelName]); // Start with top level element
99 for (auto& elem : mElements) {
100 computeRank(elem.second);
101 }
102
103 // Create DFT
104 storm::dft::storage::DFT<ValueType> dft(elements, mElements[mTopLevelName]);
105
106 // Set layout info
107 for (auto& elem : mElements) {
108 if (mLayoutInfo.count(elem.first) > 0) {
109 // Use given layout info
110 dft.setElementLayoutInfo(elem.second->id(), mLayoutInfo.at(elem.first));
111 } else {
112 // Set default layout
114 }
115 }
116
117 return dft;
118}
119
120template<typename ValueType>
121void DFTBuilder<ValueType>::addElement(DFTElementPointer element) {
122 STORM_LOG_THROW(!nameInUse(element->name()), storm::exceptions::InvalidArgumentException, "Element with name '" << element->name() << "' already exists.");
123 STORM_LOG_ASSERT(mNextId == mElements.size(), "Current id " << mNextId << " and number of elements " << mElements.size() << " do not match.");
124 element->setId(mNextId++);
125 mElements[element->name()] = element;
126}
127
128template<typename ValueType>
129void DFTBuilder<ValueType>::addBasicElementConst(std::string const& name, bool failed) {
130 addElement(std::make_shared<storm::dft::storage::elements::BEConst<ValueType>>(0, name, failed));
131}
132
133template<typename ValueType>
134void DFTBuilder<ValueType>::addBasicElementProbability(std::string const& name, ValueType probability, ValueType dormancyFactor) {
135 // Handle special cases
136 if (storm::utility::isZero<ValueType>(probability)) {
137 addBasicElementConst(name, false);
138 } else if (storm::utility::isOne<ValueType>(probability)) {
139 addBasicElementConst(name, true);
140 } else {
141 STORM_LOG_THROW(isValidProbability(probability), storm::exceptions::WrongFormatException,
142 "Failure probability " << probability << " of BE " << name << " is not within interval [0, 1].");
143 STORM_LOG_THROW(isValidProbability(dormancyFactor), storm::exceptions::WrongFormatException,
144 "Dormancy factor " << dormancyFactor << " of BE " << name << " is not within interval [0, 1].");
145 addElement(std::make_shared<storm::dft::storage::elements::BEProbability<ValueType>>(0, name, probability, dormancyFactor));
146 }
147}
148
149template<typename ValueType>
150void DFTBuilder<ValueType>::addBasicElementExponential(std::string const& name, ValueType rate, ValueType dormancyFactor, bool transient) {
151 // Handle special cases
152 if (storm::utility::isZero<ValueType>(rate)) {
153 addBasicElementConst(name, false);
154 } else {
155 STORM_LOG_THROW(this->comparator.isLess(storm::utility::zero<ValueType>(), rate), storm::exceptions::WrongFormatException,
156 "Failure rate " << rate << " of BE " << name << " must be positive.");
157 STORM_LOG_THROW(isValidProbability(dormancyFactor), storm::exceptions::WrongFormatException,
158 "Dormancy factor " << dormancyFactor << " of BE " << name << " is not within interval [0, 1].");
159 addElement(std::make_shared<storm::dft::storage::elements::BEExponential<ValueType>>(0, name, rate, dormancyFactor, transient));
160 }
161}
162
163template<typename ValueType>
164void DFTBuilder<ValueType>::addBasicElementErlang(std::string const& name, ValueType rate, unsigned phases, ValueType dormancyFactor) {
165 // Handle special cases
166 if (storm::utility::isZero<ValueType>(rate)) {
167 addBasicElementConst(name, false);
168 } else if (phases == 1) {
169 // shape=1 reduces to exponential distribution
170 addBasicElementExponential(name, rate, dormancyFactor);
171 } else {
172 STORM_LOG_THROW(this->comparator.isLess(storm::utility::zero<ValueType>(), rate), storm::exceptions::WrongFormatException,
173 "Erlang distribution of BE " << name << " requires a positive rate.");
174 STORM_LOG_THROW(phases > 0, storm::exceptions::WrongFormatException, "Erlang distribution of BE " << name << " requires a positive number of phases.");
175 STORM_LOG_THROW(isValidProbability(dormancyFactor), storm::exceptions::WrongFormatException,
176 "Dormancy factor " << dormancyFactor << " of BE " << name << " is not within interval [0, 1].");
177 addElement(std::make_shared<storm::dft::storage::elements::BEErlang<ValueType>>(0, name, rate, phases, dormancyFactor));
178 }
179}
180
181template<typename ValueType>
182void DFTBuilder<ValueType>::addBasicElementWeibull(std::string const& name, ValueType shape, ValueType rate) {
183 STORM_LOG_THROW(this->comparator.isLess(storm::utility::zero<ValueType>(), rate), storm::exceptions::WrongFormatException,
184 "Weibull distribution of BE " << name << " requires a positive scale.");
185 STORM_LOG_THROW(this->comparator.isLess(storm::utility::zero<ValueType>(), shape), storm::exceptions::WrongFormatException,
186 "Weibull distribution of BE " << name << " requires a positive shape.");
187
188 // Handle special cases
189 if (storm::utility::isOne<ValueType>(shape)) {
190 // shape=1 reduces to exponential distribution with rate 1/lambda
191 addBasicElementExponential(name, storm::utility::one<ValueType>() / rate, storm::utility::one<ValueType>());
192 } else {
193 addElement(std::make_shared<storm::dft::storage::elements::BEWeibull<ValueType>>(0, name, shape, rate));
194 }
195}
196
197template<typename ValueType>
198void DFTBuilder<ValueType>::addBasicElementLogNormal(std::string const& name, ValueType mean, ValueType standardDeviation) {
199 STORM_LOG_THROW(this->comparator.isLess(storm::utility::zero<ValueType>(), standardDeviation), storm::exceptions::WrongFormatException,
200 "Log-normal distribution of BE " << name << " requires a positive standard deviation.");
201 addElement(std::make_shared<storm::dft::storage::elements::BELogNormal<ValueType>>(0, name, mean, standardDeviation));
202}
203
204template<typename ValueType>
205void DFTBuilder<ValueType>::addBasicElementSamples(std::string const& name, std::map<ValueType, ValueType> const& activeSamples) {
206 // Check if it can fail
207 bool canFail = false;
208 for (auto const& sample : activeSamples) {
209 // At least one sample is not zero
210 if (!storm::utility::isZero(sample.second)) {
211 canFail = true;
212 break;
213 }
214 }
215 if (!canFail) {
216 // Add constant failed BE instead
217 addBasicElementConst(name, false);
218 } else {
219 addElement(std::make_shared<storm::dft::storage::elements::BESamples<ValueType>>(0, name, activeSamples));
220 }
221}
222
223template<typename ValueType>
224void DFTBuilder<ValueType>::addGate(DFTGatePointer gate, std::vector<std::string> const& children) {
225 STORM_LOG_THROW(children.size() > 0, storm::exceptions::WrongFormatException, "No children given for gate " << gate << ".");
226 mChildNames[gate] = children;
227 addElement(gate);
228}
229
230template<typename ValueType>
231void DFTBuilder<ValueType>::addAndGate(std::string const& name, std::vector<std::string> const& children) {
232 addGate(std::make_shared<storm::dft::storage::elements::DFTAnd<ValueType>>(0, name), children);
233}
234
235template<typename ValueType>
236void DFTBuilder<ValueType>::addOrGate(std::string const& name, std::vector<std::string> const& children) {
237 addGate(std::make_shared<storm::dft::storage::elements::DFTOr<ValueType>>(0, name), children);
238}
239
240template<typename ValueType>
241void DFTBuilder<ValueType>::addVotingGate(std::string const& name, unsigned threshold, std::vector<std::string> const& children) {
242 STORM_LOG_THROW(threshold <= children.size(), storm::exceptions::WrongFormatException,
243 "Voting gate " << name << " has threshold " << threshold << " higher than the number of children " << children.size() << ".");
244 // Handle special cases
245 if (children.size() == threshold) {
246 addAndGate(name, children);
247 } else if (threshold == 1) {
248 addOrGate(name, children);
249 } else {
250 addGate(std::make_shared<storm::dft::storage::elements::DFTVot<ValueType>>(0, name, threshold), children);
251 }
252}
253
254template<typename ValueType>
255void DFTBuilder<ValueType>::addPandGate(std::string const& name, std::vector<std::string> const& children, bool inclusive) {
256 addGate(std::make_shared<storm::dft::storage::elements::DFTPand<ValueType>>(0, name, inclusive), children);
257}
258
259template<typename ValueType>
260void DFTBuilder<ValueType>::addPorGate(std::string const& name, std::vector<std::string> const& children, bool inclusive) {
261 addGate(std::make_shared<storm::dft::storage::elements::DFTPor<ValueType>>(0, name, inclusive), children);
262}
263
264template<typename ValueType>
265void DFTBuilder<ValueType>::addSpareGate(std::string const& name, std::vector<std::string> const& children) {
266 addGate(std::make_shared<storm::dft::storage::elements::DFTSpare<ValueType>>(0, name), children);
267}
268
269template<typename ValueType>
270void DFTBuilder<ValueType>::addDependency(DFTDependencyPointer dependency, std::vector<std::string> const& children) {
271 STORM_LOG_THROW(children.size() > 1, storm::exceptions::WrongFormatException, "Dependency " << dependency->name() << " requires at least two children.");
272 if (storm::utility::isZero(dependency->probability())) {
273 STORM_LOG_WARN("Dependency " << dependency->name() << " with probability 0 is superfluous and will not be added.");
274 } else {
275 STORM_LOG_THROW(isValidProbability(dependency->probability()), storm::exceptions::WrongFormatException,
276 "Probability " << dependency->probability() << " of PDEP " << *dependency << " is not within interval [0, 1].");
277 mDependencyChildNames[dependency] = children;
278 addElement(dependency);
279 }
280}
281
282template<typename ValueType>
283void DFTBuilder<ValueType>::addPdep(std::string const& name, std::vector<std::string> const& children, ValueType probability) {
284 addDependency(std::make_shared<storm::dft::storage::elements::DFTDependency<ValueType>>(0, name, probability), children);
285}
286
287template<typename ValueType>
288void DFTBuilder<ValueType>::addRestriction(DFTRestrictionPointer restriction, std::vector<std::string> const& children) {
289 STORM_LOG_THROW(children.size() > 1, storm::exceptions::WrongFormatException, "Restriction " << restriction->name() << " requires at least two children.");
290 mRestrictionChildNames[restriction] = children;
291 addElement(restriction);
292}
293
294template<typename ValueType>
295void DFTBuilder<ValueType>::addSequenceEnforcer(std::string const& name, std::vector<std::string> const& children) {
296 addRestriction(std::make_shared<storm::dft::storage::elements::DFTSeq<ValueType>>(0, name), children);
297}
298
299template<typename ValueType>
300void DFTBuilder<ValueType>::addMutex(std::string const& name, std::vector<std::string> const& children) {
301 addRestriction(std::make_shared<storm::dft::storage::elements::DFTMutex<ValueType>>(0, name), children);
302}
303
304template<typename ValueType>
305void DFTBuilder<ValueType>::setTopLevel(std::string const& tle) {
306 STORM_LOG_THROW(mTopLevelName.empty(), storm::exceptions::WrongFormatException, "Top level element was already set");
307 STORM_LOG_THROW(nameInUse(tle), storm::exceptions::InvalidArgumentException, "Element with name '" << tle << "' not known.");
308 mTopLevelName = tle;
309}
310
311template<typename ValueType>
312void DFTBuilder<ValueType>::addLayoutInfo(std::string const& name, double x, double y) {
313 STORM_LOG_THROW(nameInUse(name), storm::exceptions::InvalidArgumentException, "Element with name '" << name << "' not found.");
314 mLayoutInfo[name] = storm::dft::storage::DFTLayoutInfo(x, y);
315}
316
317template<typename ValueType>
318void DFTBuilder<ValueType>::cloneElement(DFTElementCPointer element) {
319 switch (element->type()) {
321 addElement(element->clone());
322 break;
331 auto elemWithChildren = std::static_pointer_cast<storm::dft::storage::elements::DFTChildren<ValueType> const>(element);
332 std::vector<std::string> children{};
333 for (DFTElementPointer const& elem : elemWithChildren->children()) {
334 children.push_back(elem->name());
335 }
336 cloneElementWithNewChildren(elemWithChildren, children);
337 break;
338 }
340 auto dependency = std::static_pointer_cast<storm::dft::storage::elements::DFTDependency<ValueType> const>(element);
341 std::vector<std::string> children = {dependency->triggerEvent()->name()};
342 for (auto const& depEv : dependency->dependentEvents()) {
343 children.push_back(depEv->name());
344 }
345 addDependency(std::static_pointer_cast<storm::dft::storage::elements::DFTDependency<ValueType>>(dependency->clone()), children);
346 break;
347 }
348 default:
349 STORM_LOG_THROW(false, storm::exceptions::InvalidArgumentException, "DFT element type '" << element->type() << "' not known.");
350 break;
351 }
352}
353
354template<typename ValueType>
355void DFTBuilder<ValueType>::cloneElementWithNewChildren(DFTChildrenCPointer elemWithChildren, std::vector<std::string> const& children) {
356 switch (elemWithChildren->type()) {
363 addGate(std::static_pointer_cast<storm::dft::storage::elements::DFTGate<ValueType>>(elemWithChildren->clone()), children);
364 break;
367 addRestriction(std::static_pointer_cast<storm::dft::storage::elements::DFTRestriction<ValueType>>(elemWithChildren->clone()), children);
368 break;
369 default:
370 STORM_LOG_THROW(false, storm::exceptions::InvalidArgumentException, "DFT element type '" << elemWithChildren->type() << "' not known.");
371 break;
372 }
373}
374
375template<typename ValueType>
376void DFTBuilder<ValueType>::topologicalVisit(DFTElementPointer const& element,
377 std::map<DFTElementPointer, topoSortColour, storm::dft::storage::OrderElementsById<ValueType>>& visited,
378 DFTElementVector& visitedElements) {
379 STORM_LOG_THROW(visited[element] != topoSortColour::GREY, storm::exceptions::WrongFormatException, "DFT is cyclic.");
380 if (visited[element] == topoSortColour::WHITE) {
381 // Mark as currently visiting
382 visited[element] = topoSortColour::GREY;
383 // Element was not visited before
384 if (element->isGate()) {
385 for (DFTElementPointer const& child : std::static_pointer_cast<storm::dft::storage::elements::DFTGate<ValueType>>(element)->children()) {
386 // Recursively visit all children
387 topologicalVisit(child, visited, visitedElements);
388 }
389 }
390 // TODO: restrictions and dependencies have no parents, so this can be done more efficiently.
391 else if (element->isRestriction()) {
392 for (DFTElementPointer const& child : std::static_pointer_cast<storm::dft::storage::elements::DFTRestriction<ValueType>>(element)->children()) {
393 // Recursively visit all children
394 topologicalVisit(child, visited, visitedElements);
395 }
396 } else if (element->isDependency()) {
397 for (DFTElementPointer const& child :
398 std::static_pointer_cast<storm::dft::storage::elements::DFTDependency<ValueType>>(element)->dependentEvents()) {
399 // Recursively visit all dependent children
400 topologicalVisit(child, visited, visitedElements);
401 }
402 // Visit trigger element
403 topologicalVisit(std::static_pointer_cast<storm::dft::storage::elements::DFTDependency<ValueType>>(element)->triggerEvent(), visited,
404 visitedElements);
405 } else {
406 STORM_LOG_ASSERT(element->isBasicElement(), "Unknown element type " << element->type() << " for " << *element);
407 }
408 // Mark as completely visited
409 visited[element] = topoSortColour::BLACK;
410 // Children have all been visited before -> add element to list
411 visitedElements.push_back(element);
412 }
413}
414
415template<typename ValueType>
416bool DFTBuilder<ValueType>::nameInUse(std::string const& name) const {
417 return mElements.find(name) != mElements.end();
418}
419
420template<typename ValueType>
421bool DFTBuilder<ValueType>::isValidProbability(ValueType value) const {
422 if (this->comparator.isZero(value) || this->comparator.isOne(value)) {
423 return true;
424 } else if (!this->comparator.isConstant(value)) {
425 // Do not check further if value is non-constant rational function
426 return true;
427 } else if (this->comparator.isLess(storm::utility::zero<ValueType>(), value) && this->comparator.isLess(value, storm::utility::one<ValueType>())) {
428 return true;
429 }
430 return false;
431}
432
433template<typename ValueType>
434std::vector<std::shared_ptr<storm::dft::storage::elements::DFTElement<ValueType>>> DFTBuilder<ValueType>::sortTopological() {
435 // Prepare map
436 std::map<DFTElementPointer, topoSortColour, storm::dft::storage::OrderElementsById<ValueType>> visited;
437 for (auto const& e : mElements) {
438 visited.insert(std::make_pair(e.second, topoSortColour::WHITE));
439 }
440
441 DFTElementVector visitedElements; // Return argument
442 // Start from top level element
443 topologicalVisit(mElements[mTopLevelName], visited, visitedElements);
444 for (auto const& e : visited) {
445 // Visit all elements to account for restrictions/dependencies/etc. not directly reachable from top level element
446 topologicalVisit(e.first, visited, visitedElements);
447 }
448 return visitedElements;
449}
450
451template<typename ValueType>
452size_t DFTBuilder<ValueType>::computeRank(DFTElementPointer const& elem) {
453 if (elem->rank() == static_cast<decltype(elem->rank())>(-1)) {
454 // Compute rank
455 if (elem->isBasicElement() || elem->isDependency() || elem->isRestriction()) {
456 // Rank is 0 for BEs/dependencies/restrictions
457 elem->setRank(0);
458 } else {
459 // Rank is maximal rank of children + 1
460 DFTGatePointer gate = std::static_pointer_cast<storm::dft::storage::elements::DFTGate<ValueType>>(elem);
461 size_t maxRank = 0;
462 for (DFTElementPointer const& child : gate->children()) {
463 maxRank = std::max(maxRank, computeRank(child));
464 }
465 elem->setRank(maxRank + 1);
466 }
467 }
468
469 return elem->rank();
470}
471
472// Explicitly instantiate the class.
473template class DFTBuilder<double>;
474template class DFTBuilder<RationalFunction>;
475
476} // namespace builder
477} // namespace storm::dft
void addPdep(std::string const &name, std::vector< std::string > const &children, ValueType probability)
Create (probabilistic) dependency (PDEP) and add it to DFT.
void addOrGate(std::string const &name, std::vector< std::string > const &children)
Create OR-gate and add it to DFT.
void addVotingGate(std::string const &name, unsigned threshold, std::vector< std::string > const &children)
Create VOTing-gate and add it to DFT.
void addBasicElementSamples(std::string const &name, std::map< ValueType, ValueType > const &activeSamples)
Create BE with distribution given by sample points and add it to DFT.
void addBasicElementErlang(std::string const &name, ValueType rate, unsigned phases, ValueType dormancyFactor)
Create BE with Erlang distribution and add it to DFT.
void addLayoutInfo(std::string const &name, double x, double y)
Add layout information for DFT element.
void addSpareGate(std::string const &name, std::vector< std::string > const &children)
Create SPARE-gate and add it to DFT.
void addBasicElementConst(std::string const &name, bool failed)
Create BE which is constant failed or constant failsafe and add it to DFT.
storm::dft::storage::DFT< ValueType > build()
Create DFT.
void addAndGate(std::string const &name, std::vector< std::string > const &children)
Create AND-gate and add it to DFT.
void addBasicElementProbability(std::string const &name, ValueType probability, ValueType dormancyFactor)
Create BE with constant (Bernoulli) distribution and add it to DFT.
void cloneElement(DFTElementCPointer element)
Clone element and add it via the builder.
void setTopLevel(std::string const &tle)
Set top level element.
void cloneElementWithNewChildren(DFTChildrenCPointer elemWithChildren, std::vector< std::string > const &children)
Clone element, replace its children with the given children and add it via the builder.
void addBasicElementExponential(std::string const &name, ValueType rate, ValueType dormancyFactor, bool transient=false)
Create BE with exponential distribution and add it to DFT.
void addPorGate(std::string const &name, std::vector< std::string > const &children, bool inclusive=true)
Create POR-gate and add it to DFT.
void addSequenceEnforcer(std::string const &name, std::vector< std::string > const &children)
Create sequence enforcer (SEQ) and add it to DFT.
void addPandGate(std::string const &name, std::vector< std::string > const &children, bool inclusive=true)
Create PAND-gate and add it to DFT.
void addBasicElementWeibull(std::string const &name, ValueType shape, ValueType rate)
Create BE with Weibull distribution and add it to DFT.
void addBasicElementLogNormal(std::string const &name, ValueType mean, ValueType standardDeviation)
Create BE with log-normal distribution and add it to DFT.
void addMutex(std::string const &name, std::vector< std::string > const &children)
Create mutual exclusion-gate (MUTEX) and add it to DFT.
Represents a Dynamic Fault Tree.
Definition DFT.h:52
void setElementLayoutInfo(size_t id, DFTLayoutInfo const &layoutInfo)
Definition DFT.h:321
BE which is either constant failed or constant failsafe.
Definition BEConst.h:14
BE with Erlang failure distribution.
Definition BEErlang.h:13
BE with exponential failure distribution.
BE with log-normal failure distribution.
Definition BELogNormal.h:13
BE with constant (Bernoulli) failure probability distribution.
BE where the failure distribution is defined by samples.
Definition BESamples.h:16
BE with Weibull failure distribution.
Definition BEWeibull.h:13
Dependency gate with probability p.
Abstract base class for gates.
Definition DFTGate.h:13
Mutex restriction (MUTEX).
Definition DFTMutex.h:15
Priority AND (PAND) gate.
Definition DFTPand.h:17
Priority OR (POR) gate.
Definition DFTPor.h:17
Abstract base class for restrictions.
Sequence enforcer (SEQ).
Definition DFTSeq.h:15
VOT gate with threshold k.
Definition DFTVot.h:14
#define STORM_LOG_WARN(message)
Definition logging.h:30
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:11
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
SFTBDDChecker::ValueType ValueType
bool isZero(ValueType const &a)
Definition constants.cpp:41
LabParser.cpp.
Definition cli.cpp:18