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