Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
DFTState.cpp
Go to the documentation of this file.
2
7
8namespace storm::dft {
9namespace storage {
10
11template<typename ValueType>
12DFTState<ValueType>::DFTState(DFT<ValueType> const& dft, DFTStateGenerationInfo const& stateGenerationInfo, size_t id)
13 : mStatus(dft.stateBitVectorSize()),
14 mId(id),
15 failableElements(dft.nrElements()),
16 indexRelevant(0),
17 mPseudoState(false),
18 mDft(dft),
19 mStateGenerationInfo(stateGenerationInfo) {
20 // TODO: use construct()
21
22 // Initialize uses
23 for (size_t spareId : mDft.getSpareIndices()) {
24 std::shared_ptr<storm::dft::storage::elements::DFTGate<ValueType> const> elem = mDft.getGate(spareId);
25 STORM_LOG_ASSERT(elem->isSpareGate(), "Element is no spare gate.");
26 STORM_LOG_ASSERT(elem->nrChildren() > 0, "Element has no child.");
27 this->setUses(spareId, elem->children()[0]->id());
28 }
29
30 // Initialize activation and set failable BEs
31 propagateActivation(mDft.getTopLevelIndex());
32
33 // Initialize currently failable BEs
34 for (size_t id : mDft.nonColdBEs()) {
35 // Check if restriction might prevent failure
37 failableElements.addBE(id);
38 } else {
39 STORM_LOG_TRACE("BE " << id << " is disabled due to a restriction.");
40 }
41 }
42}
43
44template<typename ValueType>
45DFTState<ValueType>::DFTState(storm::storage::BitVector const& status, DFT<ValueType> const& dft, DFTStateGenerationInfo const& stateGenerationInfo, size_t id)
46 : mStatus(status), mId(id), failableElements(dft.nrElements()), indexRelevant(0), mPseudoState(true), mDft(dft), mStateGenerationInfo(stateGenerationInfo) {
47 // Intentionally left empty
48}
49
50template<typename ValueType>
52 STORM_LOG_TRACE("Construct concrete state from pseudo state " << mDft.getStateString(mStatus, mStateGenerationInfo, mId));
53 // Clear information from pseudo state
54 failableElements.clear();
55 mUsedRepresentants.clear();
56 STORM_LOG_ASSERT(mPseudoState, "Only pseudo states can be constructed.");
57 for (size_t index = 0; index < mDft.nrElements(); ++index) {
58 // Initialize currently failable BE
59 if (mDft.isBasicElement(index) && isOperational(index) && !isEventDisabledViaRestriction(index)) {
60 std::shared_ptr<const storm::dft::storage::elements::DFTBE<ValueType>> be = mDft.getBasicElement(index);
61 STORM_LOG_ASSERT(index == be->id(), "Ids do not match.");
62 if (be->canFail()) {
63 switch (be->beType()) {
65 failableElements.addBE(index);
66 STORM_LOG_TRACE("Currently failable: " << *be);
67 break;
69 auto beExp = std::static_pointer_cast<storm::dft::storage::elements::BEExponential<ValueType> const>(be);
70 if (!beExp->isColdBasicElement() || !mDft.hasRepresentant(index) || isActive(mDft.getRepresentant(index))) {
71 failableElements.addBE(index);
72 STORM_LOG_TRACE("Currently failable: " << *beExp);
73 }
74 break;
75 }
76 default:
77 STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "BE type '" << be->beType() << "' is not supported.");
78 break;
79 }
80 }
81 } else if (mDft.getElement(index)->isSpareGate()) {
82 // Initialize used representants
83 uint_fast64_t useId = uses(index);
84 mUsedRepresentants.push_back(useId);
85 STORM_LOG_TRACE("Spare " << index << " uses " << useId);
86 }
87 }
88
89 // Initialize failable dependencies
90 for (size_t dependencyId : mDft.getDependencies()) {
91 if (getDependencyState(dependencyId) == DFTDependencyState::Passive) {
92 std::shared_ptr<storm::dft::storage::elements::DFTDependency<ValueType> const> dependency = mDft.getDependency(dependencyId);
93 STORM_LOG_ASSERT(dependencyId == dependency->id(), "Ids do not match.");
94 STORM_LOG_ASSERT(dependency->dependentEvents().size() == 1, "Only one dependent event is allowed.");
95 if (hasFailed(dependency->triggerEvent()->id()) && getElementState(dependency->dependentEvents()[0]->id()) == DFTElementState::Operational) {
96 failableElements.addDependency(dependencyId, mDft.isDependencyInConflict(dependencyId));
97 STORM_LOG_TRACE("New dependency failure: " << *dependency);
98 }
99 }
100 }
101
102 mPseudoState = false;
103}
104
105template<typename ValueType>
106std::shared_ptr<DFTState<ValueType>> DFTState<ValueType>::copy() const {
107 return std::make_shared<storm::dft::storage::DFTState<ValueType>>(*this);
108}
109
110template<typename ValueType>
112 return static_cast<DFTElementState>(getElementStateInt(id));
113}
114
115template<typename ValueType>
117 return static_cast<DFTElementState>(DFTState<ValueType>::getElementStateInt(state, stateGenerationInfo, id));
118}
119
120template<typename ValueType>
122 return static_cast<DFTDependencyState>(getElementStateInt(id));
123}
124
125template<typename ValueType>
127 size_t id) {
128 return static_cast<DFTDependencyState>(DFTState<ValueType>::getElementStateInt(state, stateGenerationInfo, id));
129}
130
131template<typename ValueType>
132int DFTState<ValueType>::getElementStateInt(size_t id) const {
133 return mStatus.getAsInt(mStateGenerationInfo.getStateIndex(id), 2);
134}
135
136template<typename ValueType>
137int DFTState<ValueType>::getElementStateInt(storm::storage::BitVector const& state, DFTStateGenerationInfo const& stateGenerationInfo, size_t id) {
138 return state.getAsInt(stateGenerationInfo.getStateIndex(id), 2);
139}
140
141template<typename ValueType>
143 return mId;
144}
145
146template<typename ValueType>
148 mId = id;
149}
150
151template<typename ValueType>
153 return getElementState(id) == DFTElementState::Operational;
154}
155
156template<typename ValueType>
157bool DFTState<ValueType>::hasFailed(size_t id) const {
158 return mStatus[mStateGenerationInfo.getStateIndex(id)];
159}
160
161template<typename ValueType>
163 return state[indexId];
164}
165
166template<typename ValueType>
167bool DFTState<ValueType>::isFailsafe(size_t id) const {
168 return mStatus[mStateGenerationInfo.getStateIndex(id) + 1];
169}
170
171template<typename ValueType>
173 return state[indexId + 1];
174}
175
176template<typename ValueType>
177bool DFTState<ValueType>::dontCare(size_t id) const {
178 return getElementState(id) == DFTElementState::DontCare;
179}
180
181template<typename ValueType>
183 return getElementStateInt(id) > 0;
184}
185
186template<typename ValueType>
188 return mStatus[mStateGenerationInfo.getStateIndex(id)];
189}
190template<typename ValueType>
192 return mStatus[mStateGenerationInfo.getStateIndex(id) + 1];
193}
194
195template<typename ValueType>
197 mStatus.set(mStateGenerationInfo.getStateIndex(id));
198}
199
200template<typename ValueType>
202 mStatus.set(mStateGenerationInfo.getStateIndex(id) + 1);
203}
204
205template<typename ValueType>
207 if (mDft.isRepresentative(id)) {
208 // Activate dont care element
209 activate(id);
210 }
211 mStatus.setFromInt(mStateGenerationInfo.getStateIndex(id), 2, static_cast<uint_fast64_t>(DFTElementState::DontCare));
212}
213
214template<typename ValueType>
216 // Only distinguish between passive and dont care dependencies
217 // mStatus.set(mStateGenerationInfo.getStateIndex(id));
218 setDependencyDontCare(id);
219}
220
221template<typename ValueType>
223 // Only distinguish between passive and dont care dependencies
224 // mStatus.set(mStateGenerationInfo.getStateIndex(id)+1);
225 setDependencyDontCare(id);
226}
227
228template<typename ValueType>
230 mStatus.setFromInt(mStateGenerationInfo.getStateIndex(id), 2, static_cast<uint_fast64_t>(DFTDependencyState::DontCare));
231}
232
233template<typename ValueType>
235 failableElements.removeBE(id);
236 updateDontCareDependencies(id);
237}
238
239template<typename ValueType>
241 if (!hasFailed(id)) {
242 return false;
243 }
244
245 bool addedFailableDependency = false;
246 for (auto dependency : mDft.getElement(id)->outgoingDependencies()) {
247 STORM_LOG_ASSERT(dependency->triggerEvent()->id() == id, "Ids do not match.");
248 if (getDependencyState(dependency->id()) == DFTDependencyState::Passive) {
249 STORM_LOG_ASSERT(dependency->dependentEvents().size() == 1, "Only one dependent event is allowed.");
250 if (getElementState(dependency->dependentEvents()[0]->id()) == DFTElementState::Operational) {
251 STORM_LOG_ASSERT(!isFailsafe(dependency->dependentEvents()[0]->id()), "Dependent event is failsafe.");
252 // By assertion we have only one dependent event
253 // Check if restriction prevents failure of dependent event
254 if (!isEventDisabledViaRestriction(dependency->dependentEvents()[0]->id())) {
255 // Add dependency as possible failure
256 failableElements.addDependency(dependency->id(), mDft.isDependencyInConflict(dependency->id()));
257 STORM_LOG_TRACE("New dependency failure: " << *dependency);
258 addedFailableDependency = true;
259 }
260 }
261 }
262 }
263 return addedFailableDependency;
264}
265
266template<typename ValueType>
268 if (!hasFailed(id)) {
269 // Non-failure does not change anything in a restriction
270 return false;
271 }
272
273 bool addedFailableEvent = false;
274 for (auto restriction : mDft.getElement(id)->restrictions()) {
275 STORM_LOG_ASSERT(restriction->containsChild(id), "Ids do not match.");
276 if (restriction->isSeqEnforcer()) {
277 for (auto it = restriction->children().cbegin(); it != restriction->children().cend(); ++it) {
278 if ((*it)->id() != id) {
279 if (!hasFailed((*it)->id())) {
280 // Failure should be prevented later on
281 STORM_LOG_TRACE("Child " << (*it)->name() << " should have failed.");
282 break;
283 }
284 } else {
285 // Current event has failed
286 STORM_LOG_ASSERT(hasFailed((*it)->id()), "Child " << (*it)->name() << " should have failed.");
287 ++it;
288 while (it != restriction->children().cend() && !isOperational((*it)->id())) {
289 ++it;
290 }
291 if (it != restriction->children().cend() && (*it)->isBasicElement() && isOperational((*it)->id())) {
292 auto be = std::static_pointer_cast<storm::dft::storage::elements::DFTBE<ValueType> const>(*it);
293
294 if (be->canFail()) {
295 // Enable next event
296 failableElements.addBE((*it)->id());
297 STORM_LOG_TRACE("Added possible BE failure: " << *(*it));
298 addedFailableEvent = true;
299 }
300
301 // Also check if dependency triggering the BE could now fail
302 bool change = false;
303 for (auto dependency : be->ingoingDependencies()) {
304 change |= updateFailableDependencies(dependency->triggerEvent()->id());
305 }
306 if (change) {
307 addedFailableEvent = true;
308 }
309 }
310 break;
311 }
312 }
313 } else if (restriction->isMutex()) {
314 // Current element has failed and disables all other children
315 for (auto const& child : restriction->children()) {
316 if (child->isBasicElement() && child->id() != id && getElementState(child->id()) == DFTElementState::Operational) {
317 // Disable child
318 failableElements.removeBE(child->id());
319 STORM_LOG_TRACE("Disabled child: " << *child);
320 addedFailableEvent = true;
321 }
322 }
323 } else {
324 STORM_LOG_THROW(false, storm::exceptions::InvalidArgumentException, "Restriction must be SEQ or MUTEX");
325 }
326 }
327 return addedFailableEvent;
328}
329
330template<typename ValueType>
332 STORM_LOG_ASSERT(mDft.isBasicElement(id), "Element is no BE.");
333 STORM_LOG_ASSERT(hasFailed(id), "Element has not failed.");
334
335 for (auto dependency : mDft.getBasicElement(id)->ingoingDependencies()) {
336 assert(dependency->dependentEvents().size() == 1);
337 STORM_LOG_ASSERT(dependency->dependentEvents()[0]->id() == id, "Ids do not match.");
338 setDependencyDontCare(dependency->id());
339 failableElements.removeDependency(dependency->id());
340 }
341}
342
343template<typename ValueType>
344ValueType DFTState<ValueType>::getBERate(size_t id) const {
345 STORM_LOG_ASSERT(mDft.isBasicElement(id), "Element is no BE.");
346 STORM_LOG_THROW(mDft.getBasicElement(id)->beType() == storm::dft::storage::elements::BEType::EXPONENTIAL, storm::exceptions::NotSupportedException,
347 "BE of type '" << mDft.getBasicElement(id)->beType() << "' is not supported.");
348 auto beExp = std::static_pointer_cast<storm::dft::storage::elements::BEExponential<ValueType> const>(mDft.getBasicElement(id));
349 if (mDft.hasRepresentant(id) && !isActive(mDft.getRepresentant(id))) {
350 // Return passive failure rate
351 return beExp->passiveFailureRate();
352 } else {
353 // Return active failure rate
354 return beExp->activeFailureRate();
355 }
356}
357
358template<typename ValueType>
360 STORM_LOG_ASSERT(!hasFailed(be->id()), "Element " << *be << " has already failed.");
361 // Check if BE can fail on its own or is triggered by dependency
362 STORM_LOG_ASSERT(be->canFail() || std::any_of(be->ingoingDependencies().begin(), be->ingoingDependencies().end(),
364 return this->dependencySuccessful(dep->id());
365 }),
366 "Element " << *be << " cannot fail.");
367 // Set BE as failed
368 setFailed(be->id());
369 failableElements.removeBE(be->id());
370}
371
372template<typename ValueType>
374 STORM_LOG_ASSERT(failableElements.hasDependencies(), "Index invalid.");
375 failableElements.removeDependency(dependency->id());
376 if (successful) {
377 setDependencySuccessful(dependency->id());
378 } else {
379 STORM_LOG_ASSERT(!dependency->isFDEP(), "Dependency is not a PDEP.");
380 setDependencyUnsuccessful(dependency->id());
381 }
382}
383
384template<typename ValueType>
386 size_t activationIndex = mStateGenerationInfo.getSpareActivationIndex(repr);
387 mStatus.set(activationIndex);
388}
389
390template<typename ValueType>
391bool DFTState<ValueType>::isActive(size_t id) const {
392 STORM_LOG_ASSERT(mDft.isRepresentative(id), "Element " << *(mDft.getElement(id)) << " is no representative.");
393 return mStatus[mStateGenerationInfo.getSpareActivationIndex(id)];
394}
395
396template<typename ValueType>
397void DFTState<ValueType>::propagateActivation(size_t representativeId) {
398 if (representativeId != mDft.getTopLevelIndex()) {
399 activate(representativeId);
400 }
401 for (size_t elem : mDft.module(representativeId).getElements()) {
402 if (mDft.isBasicElement(elem) && isOperational(elem) && !isEventDisabledViaRestriction(elem)) {
403 std::shared_ptr<const storm::dft::storage::elements::DFTBE<ValueType>> be = mDft.getBasicElement(elem);
404 if (be->canFail()) {
405 switch (be->beType()) {
407 // Nothing to do
408 break;
410 auto beExp = std::static_pointer_cast<storm::dft::storage::elements::BEExponential<ValueType> const>(be);
411 if (beExp->isColdBasicElement()) {
412 // Add to failable BEs
413 failableElements.addBE(elem);
414 }
415 break;
416 }
417 default:
418 STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "BE type '" << be->beType() << "' is not supported.");
419 }
420 }
421 } else if (mDft.getElement(elem)->isSpareGate()) {
422 if (isOperational(elem)) {
423 // We do not activate children if the SPARE is already failed
424 if (!isActive(uses(elem))) {
425 propagateActivation(uses(elem));
426 }
427 }
428 }
429 }
430}
431
432template<typename ValueType>
433uint_fast64_t DFTState<ValueType>::uses(size_t id) const {
434 size_t nrUsedChild = extractUses(mStateGenerationInfo.getSpareUsageIndex(id));
435 if (nrUsedChild == mDft.getMaxSpareChildCount()) {
436 return id;
437 } else {
438 return mDft.getChild(id, nrUsedChild);
439 }
440}
441
442template<typename ValueType>
443uint_fast64_t DFTState<ValueType>::usesIndex(storm::storage::BitVector const& state, DFTStateGenerationInfo const& stateGenerationInfo, size_t id) {
444 return state.getAsInt(stateGenerationInfo.getSpareUsageIndex(id), stateGenerationInfo.usageInfoBits());
445}
446
447template<typename ValueType>
448uint_fast64_t DFTState<ValueType>::extractUses(size_t from) const {
449 STORM_LOG_ASSERT(mStateGenerationInfo.usageInfoBits() < 64, "UsageInfoBit size too large.");
450 return mStatus.getAsInt(from, mStateGenerationInfo.usageInfoBits());
451}
452
453template<typename ValueType>
454bool DFTState<ValueType>::isUsed(size_t child) const {
455 return (std::find(mUsedRepresentants.begin(), mUsedRepresentants.end(), child) != mUsedRepresentants.end());
456}
457
458template<typename ValueType>
459void DFTState<ValueType>::setUses(size_t spareId, size_t child) {
460 mStatus.setFromInt(mStateGenerationInfo.getSpareUsageIndex(spareId), mStateGenerationInfo.usageInfoBits(), mDft.getNrChild(spareId, child));
461 mUsedRepresentants.push_back(child);
462}
463
464template<typename ValueType>
466 STORM_LOG_ASSERT(hasFailed(spareId), "Spare has not failed.");
467 mStatus.setFromInt(mStateGenerationInfo.getSpareUsageIndex(spareId), mStateGenerationInfo.usageInfoBits(), mDft.getMaxSpareChildCount());
468}
469
470template<typename ValueType>
472 STORM_LOG_ASSERT(!mDft.isDependency(id), "Event " << id << " is dependency.");
473 STORM_LOG_ASSERT(!mDft.isRestriction(id), "Event " << id << " is restriction.");
474 // First check sequence enforcer
475 auto const& preIds = mStateGenerationInfo.seqRestrictionPreElements(id);
476 for (size_t id : preIds) {
477 if (isOperational(id)) {
478 return true;
479 }
480 }
481
482 // Second check mutexes
483 auto const& mutexIds = mStateGenerationInfo.mutexRestrictionElements(id);
484 for (size_t id : mutexIds) {
485 if (!isOperational(id)) {
486 return true;
487 }
488 }
489 return false;
490}
491
492template<typename ValueType>
494 STORM_LOG_ASSERT(!mDft.isDependency(id), "Element is dependency.");
495 STORM_LOG_ASSERT(!mDft.isRestriction(id), "Element is restriction.");
496
497 // First check sequence enforcer
498 auto const& postIds = mStateGenerationInfo.seqRestrictionPostElements(id);
499 for (size_t id : postIds) {
500 if (isOperational(id)) {
501 return true;
502 }
503 }
504
505 // Second check mutexes
506 auto const& mutexIds = mStateGenerationInfo.mutexRestrictionElements(id);
507 for (size_t id : mutexIds) {
508 if (isOperational(id)) {
509 return true;
510 }
511 }
512 return false;
513}
514
515template<typename ValueType>
517 // Iterate over remaining relevant events
518 // All events with index < indexRelevant are already failed
519 while (indexRelevant < mDft.getRelevantEvents().size()) {
520 if (isOperational(mDft.getRelevantEvents()[indexRelevant])) {
521 // Relevant event is still operational
522 return true;
523 } else {
524 // Consider next relevant event
525 ++indexRelevant;
526 }
527 }
528 return false;
529}
530
531template<typename ValueType>
532bool DFTState<ValueType>::claimNew(size_t spareId, size_t currentlyUses,
533 std::vector<std::shared_ptr<storm::dft::storage::elements::DFTElement<ValueType>>> const& children) {
534 auto it = children.begin();
535 while ((*it)->id() != currentlyUses) {
536 STORM_LOG_ASSERT(it != children.end(), "Currently used element not found.");
537 ++it;
538 }
539 ++it;
540 while (it != children.end()) {
541 size_t childId = (*it)->id();
542 if (!hasFailed(childId) && !isUsed(childId)) {
543 setUses(spareId, childId);
544 if (isActive(currentlyUses)) {
545 propagateActivation(childId);
546 }
547 return true;
548 }
549 ++it;
550 }
551 return false;
552}
553
554template<typename ValueType>
556 bool changed = false;
557 for (size_t pos = 0; pos < mStateGenerationInfo.getSymmetrySize(); ++pos) {
558 // Check each symmetry
559 size_t length = mStateGenerationInfo.getSymmetryLength(pos);
560 std::vector<size_t> symmetryIndices = mStateGenerationInfo.getSymmetryIndices(pos);
561 // Sort symmetry group in decreasing order by bubble sort
562 // TODO use better algorithm?
563 size_t tmp;
564 size_t n = symmetryIndices.size();
565 do {
566 tmp = 0;
567 for (size_t i = 1; i < n; ++i) {
568 STORM_LOG_ASSERT(symmetryIndices[i - 1] + length <= mStatus.size(),
569 "Symmetry index " << symmetryIndices[i - 1] << " + length " << length << " is larger than status vector " << mStatus.size());
570 STORM_LOG_ASSERT(symmetryIndices[i] + length <= mStatus.size(),
571 "Symmetry index " << symmetryIndices[i] << " + length " << length << " is larger than status vector " << mStatus.size());
572 if (mStatus.compareAndSwap(symmetryIndices[i - 1], symmetryIndices[i], length)) {
573 tmp = i;
574 changed = true;
575 }
576 }
577 n = tmp;
578 } while (n > 0);
579 }
580 if (changed) {
581 mPseudoState = true;
582 }
583 return changed;
584}
585
586// Explicitly instantiate the class.
587template class DFTState<double>;
588template class DFTState<RationalFunction>;
589
590} // namespace storage
591} // namespace storm::dft
Represents a Dynamic Fault Tree.
Definition DFT.h:52
void letBEFail(std::shared_ptr< storm::dft::storage::elements::DFTBE< ValueType > const > be)
Sets the next BE as failed.
Definition DFTState.cpp:359
void setDependencyDontCare(size_t id)
Definition DFTState.cpp:229
bool dependencyUnsuccessful(size_t id) const
Definition DFTState.cpp:191
std::shared_ptr< DFTState< ValueType > > copy() const
Definition DFTState.cpp:106
ValueType getBERate(size_t id) const
Get the current failure rate of the given BE.
Definition DFTState.cpp:344
DFTState(DFT< ValueType > const &dft, DFTStateGenerationInfo const &stateGenerationInfo, size_t id)
Construct the initial state.
Definition DFTState.cpp:12
bool claimNew(size_t spareId, size_t currentlyUses, std::vector< std::shared_ptr< storm::dft::storage::elements::DFTElement< ValueType > > > const &children)
Claim a new spare child for the given spare gate.
Definition DFTState.cpp:532
void beNoLongerFailable(size_t id)
Definition DFTState.cpp:234
void activate(size_t repr)
Definition DFTState.cpp:385
DFTDependencyState getDependencyState(size_t id) const
Definition DFTState.cpp:121
void letDependencyTrigger(std::shared_ptr< storm::dft::storage::elements::DFTDependency< ValueType > const > dependency, bool successful=true)
Trigger the dependency and set it as successful/unsuccessful.
Definition DFTState.cpp:373
bool hasFailed(size_t id) const
Definition DFTState.cpp:157
uint_fast64_t uses(size_t id) const
This method returns the id of the used child for a spare.
Definition DFTState.cpp:433
bool isUsed(size_t child) const
Checks whether an element is currently used.
Definition DFTState.cpp:454
bool isActive(size_t id) const
Definition DFTState.cpp:391
bool hasOperationalRelevantEvent()
Check whether at least one relevant event is still operational.
Definition DFTState.cpp:516
bool updateFailableDependencies(size_t id)
Sets all failable BEs due to dependencies from newly failed element.
Definition DFTState.cpp:240
bool dependencySuccessful(size_t id) const
Definition DFTState.cpp:187
bool isEventRelevantInRestriction(size_t id) const
Check whether the event is still relevant for any restriction.
Definition DFTState.cpp:493
void finalizeUses(size_t spareId)
Sets the use for the spare to a default value to gain consistent states after failures.
Definition DFTState.cpp:465
bool orderBySymmetry()
Order the state in decreasing order using the symmetries.
Definition DFTState.cpp:555
uint_fast64_t extractUses(size_t from) const
This method is commonly used to get the usage information for spares.
Definition DFTState.cpp:448
bool dontCare(size_t id) const
Definition DFTState.cpp:177
bool isOperational(size_t id) const
Definition DFTState.cpp:152
bool updateFailableInRestrictions(size_t id)
Sets all failable BEs due to restrictions from newly failed element.
Definition DFTState.cpp:267
bool isEventDisabledViaRestriction(size_t id) const
Check whether the event cannot fail at the moment due to a restriction.
Definition DFTState.cpp:471
void setDependencyUnsuccessful(size_t id)
Definition DFTState.cpp:222
DFTElementState getElementState(size_t id) const
Definition DFTState.cpp:111
void updateDontCareDependencies(size_t id)
Sets all dependencies dont care whose dependent event is the newly failed BE.
Definition DFTState.cpp:331
void setUses(size_t spareId, size_t child)
Sets for the spare which child is now used.
Definition DFTState.cpp:459
bool isFailsafe(size_t id) const
Definition DFTState.cpp:167
bool dependencyTriggered(size_t id) const
Definition DFTState.cpp:182
void construct()
Construct concrete state from pseudo state by using the underlying bitvector.
Definition DFTState.cpp:51
void setDependencySuccessful(size_t id)
Definition DFTState.cpp:215
static uint_fast64_t usesIndex(storm::storage::BitVector const &state, DFTStateGenerationInfo const &stateGenerationInfo, size_t id)
Returns the index of the used child for a spare gate.
Definition DFTState.cpp:443
void addBE(size_t id)
Add failable BE.
Abstract base class for basic events (BEs) in DFTs.
Definition DFTBE.h:14
Dependency gate with probability p.
Abstract base class for DFT elements.
Definition DFTElement.h:38
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:16
void set(uint64_t index, bool value=true)
Sets the given truth value at the given index.
uint64_t getAsInt(uint64_t bitIndex, uint64_t numberOfBits) const
Retrieves the content of the current bit vector at the given index for the given number of bits as an...
#define STORM_LOG_TRACE(message)
Definition logging.h:12
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:11
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30