Browse Source

Removed mChildren in DFTRestriction

main
Matthias Volk 6 years ago
parent
commit
5ba2c6357e
  1. 5
      src/storm-dft/storage/dft/elements/DFTChildren.h
  2. 4
      src/storm-dft/storage/dft/elements/DFTGate.h
  3. 20
      src/storm-dft/storage/dft/elements/DFTRestriction.h

5
src/storm-dft/storage/dft/elements/DFTChildren.h

@ -158,6 +158,11 @@ namespace storm {
return false; return false;
} }
virtual void fail(DFTState<ValueType>& state, DFTStateSpaceGenerationQueues<ValueType>& queues) const = 0;
virtual void failsafe(DFTState<ValueType>& state, DFTStateSpaceGenerationQueues<ValueType>& queues) const = 0;
private: private:
DFTElementVector mChildren; DFTElementVector mChildren;

4
src/storm-dft/storage/dft/elements/DFTGate.h

@ -67,7 +67,7 @@ namespace storm {
protected: protected:
virtual void fail(DFTState<ValueType>& state, DFTStateSpaceGenerationQueues<ValueType>& queues) const {
void fail(DFTState<ValueType>& state, DFTStateSpaceGenerationQueues<ValueType>& queues) const override {
for (std::shared_ptr<DFTGate> parent : this->mParents) { for (std::shared_ptr<DFTGate> parent : this->mParents) {
if (state.isOperational(parent->id())) { if (state.isOperational(parent->id())) {
queues.propagateFailure(parent); queues.propagateFailure(parent);
@ -80,7 +80,7 @@ namespace storm {
this->childrenDontCare(state, queues); this->childrenDontCare(state, queues);
} }
virtual void failsafe(DFTState<ValueType>& state, DFTStateSpaceGenerationQueues<ValueType>& queues) const {
void failsafe(DFTState<ValueType>& state, DFTStateSpaceGenerationQueues<ValueType>& queues) const override {
for (std::shared_ptr<DFTGate> parent : this->mParents) { for (std::shared_ptr<DFTGate> parent : this->mParents) {
if (state.isOperational(parent->id())) { if (state.isOperational(parent->id())) {
queues.propagateFailsafe(parent); queues.propagateFailsafe(parent);

20
src/storm-dft/storage/dft/elements/DFTRestriction.h

@ -49,7 +49,7 @@ namespace storm {
* @return True iff all children are BEs. * @return True iff all children are BEs.
*/ */
bool allChildrenBEs() const { bool allChildrenBEs() const {
for (auto const& elem : mChildren) {
for (auto const& elem : this->children()) {
if (!elem->isBasicElement()) { if (!elem->isBasicElement()) {
return false; return false;
} }
@ -57,25 +57,23 @@ namespace storm {
return true; return true;
} }
virtual void extendSpareModule(std::set<size_t>& elementsInSpareModule) const override {
void extendSpareModule(std::set<size_t>& elementsInSpareModule) const override {
// Do nothing // Do nothing
} }
virtual bool checkDontCareAnymore(storm::storage::DFTState<ValueType>& state, DFTStateSpaceGenerationQueues <ValueType>& queues) const override {
bool checkDontCareAnymore(storm::storage::DFTState<ValueType>& state, DFTStateSpaceGenerationQueues <ValueType>& queues) const override {
return false; return false;
} }
protected: protected:
void fail(DFTState <ValueType>& state, DFTStateSpaceGenerationQueues <ValueType>& queues) const {
void fail(DFTState <ValueType>& state, DFTStateSpaceGenerationQueues <ValueType>& queues) const override {
state.markAsInvalid(); state.markAsInvalid();
} }
void failsafe(DFTState <ValueType>& state, DFTStateSpaceGenerationQueues <ValueType>& queues) const {
void failsafe(DFTState <ValueType>& state, DFTStateSpaceGenerationQueues <ValueType>& queues) const override {
} }
DFTElementVector mChildren;
}; };
@ -98,18 +96,18 @@ namespace storm {
// Intentionally left empty. // Intentionally left empty.
} }
virtual DFTElementType type() const override {
DFTElementType type() const override {
return DFTElementType::SEQ; return DFTElementType::SEQ;
} }
virtual bool isSeqEnforcer() const override {
bool isSeqEnforcer() const override {
return true; return true;
} }
void checkFails(storm::storage::DFTState<ValueType>& state, DFTStateSpaceGenerationQueues <ValueType>& queues) const override { void checkFails(storm::storage::DFTState<ValueType>& state, DFTStateSpaceGenerationQueues <ValueType>& queues) const override {
STORM_LOG_ASSERT(queues.failurePropagationDone(), "Failure propagation not finished."); STORM_LOG_ASSERT(queues.failurePropagationDone(), "Failure propagation not finished.");
bool childOperationalBefore = false; bool childOperationalBefore = false;
for (auto const& child : this->mChildren) {
for (auto const& child : this->children()) {
if (!state.hasFailed(child->id())) { if (!state.hasFailed(child->id())) {
childOperationalBefore = true; childOperationalBefore = true;
} else if (childOperationalBefore && state.hasFailed(child->id())) { } else if (childOperationalBefore && state.hasFailed(child->id())) {
@ -122,7 +120,7 @@ namespace storm {
void checkFailsafe(storm::storage::DFTState<ValueType>& state, DFTStateSpaceGenerationQueues <ValueType>& queues) const override { void checkFailsafe(storm::storage::DFTState<ValueType>& state, DFTStateSpaceGenerationQueues <ValueType>& queues) const override {
} }
virtual bool checkDontCareAnymore(storm::storage::DFTState<ValueType>& state, DFTStateSpaceGenerationQueues <ValueType>& queues) const override {
bool checkDontCareAnymore(storm::storage::DFTState<ValueType>& state, DFTStateSpaceGenerationQueues <ValueType>& queues) const override {
// Actually, it doesnt matter what we return here.. // Actually, it doesnt matter what we return here..
return false; return false;
} }

Loading…
Cancel
Save