diff --git a/src/storage/dft/DFTElements.h b/src/storage/dft/DFTElements.h index e49b91901..b7fca51c0 100644 --- a/src/storage/dft/DFTElements.h +++ b/src/storage/dft/DFTElements.h @@ -122,7 +122,7 @@ namespace storm { bool hasParents() const { return !mParents.empty(); } - + size_t nrParents() const { return mParents.size(); } @@ -194,7 +194,9 @@ namespace storm { */ virtual void extendSubDft(std::set elemsInSubtree, std::vector const& parentsOfSubRoot) const; - + virtual bool isTypeEqualTo(DFTElement const& other) const { + return type() == other.type(); + } protected: @@ -368,7 +370,7 @@ namespace storm { } return false; } - + }; @@ -413,6 +415,13 @@ namespace storm { bool isColdBasicElement() const override{ return storm::utility::isZero(mPassiveFailureRate); } + + bool isTypeEqualTo(DFTElement const& other) const override { + if(!DFTElement::isTypeEqualTo(other)) return false; + DFTBE const& otherBE = static_cast const&>(other); + return (mActiveFailureRate == otherBE.mActiveFailureRate) && (mPassiveFailureRate == otherBE.mPassiveFailureRate); + } + virtual bool checkDontCareAnymore(storm::storage::DFTState& state, DFTStateSpaceGenerationQueues& queues) const override; }; @@ -454,6 +463,12 @@ namespace storm { return 0; } + bool isTypeEqualTo(DFTElement const& other) const override { + if(!DFTElement::isTypeEqualTo(other)) return false; + DFTConst const& otherCNST = static_cast const&>(other); + return (mFailed == otherCNST.mFailed); + } + }; @@ -518,6 +533,13 @@ namespace storm { virtual bool isDependency() const override { return true; } + + virtual bool isTypeEqualTo(DFTElement const& other) const override { + if(!DFTElement::isTypeEqualTo(other)) return false; + DFTDependency const& otherDEP= static_cast const&>(other); + return (mProbability == otherDEP.mProbability); + } + virtual std::vector independentUnit() const override { std::set unit = {this->mId}; @@ -819,7 +841,12 @@ namespace storm { std::string typestring() const override{ return "VOT (" + std::to_string(mThreshold) + ")"; } - + + virtual bool isTypeEqualTo(DFTElement const& other) const override { + if(!DFTElement::isTypeEqualTo(other)) return false; + DFTVot const& otherVOT = static_cast const&>(other); + return (mThreshold == otherVOT.mThreshold); + } }; template @@ -887,7 +914,12 @@ namespace storm { } } }; - + + template + bool equalType(DFTElement const& e1, DFTElement const& e2) { + return e1.isTypeEqualTo(e2); + } + } }