Browse Source

Fixed computation of dormancy factor for lambda=0

tempestpy_adaptions
Matthias Volk 6 years ago
parent
commit
7697254635
  1. 6
      src/storm-dft/builder/DFTBuilder.cpp
  2. 3
      src/storm-dft/storage/dft/DftJsonExporter.cpp
  3. 9
      src/storm-dft/storage/dft/elements/DFTBE.h

6
src/storm-dft/builder/DFTBuilder.cpp

@ -268,11 +268,7 @@ namespace storm {
case storm::storage::DFTElementType::BE: case storm::storage::DFTElementType::BE:
{ {
std::shared_ptr<storm::storage::DFTBE<ValueType>> be = std::static_pointer_cast<storm::storage::DFTBE<ValueType>>(element); std::shared_ptr<storm::storage::DFTBE<ValueType>> be = std::static_pointer_cast<storm::storage::DFTBE<ValueType>>(element);
ValueType dormancyFactor = storm::utility::zero<ValueType>();
if (be->canFail()) {
dormancyFactor = be->passiveFailureRate() / be->activeFailureRate();
}
addBasicElement(be->name(), be->activeFailureRate(), dormancyFactor, be->isTransient());
addBasicElement(be->name(), be->activeFailureRate(), be->dormancyFactor(), be->isTransient());
break; break;
} }
case storm::storage::DFTElementType::CONSTF: case storm::storage::DFTElementType::CONSTF:

3
src/storm-dft/storage/dft/DftJsonExporter.cpp

@ -88,8 +88,7 @@ namespace storm {
stream << be->activeFailureRate(); stream << be->activeFailureRate();
nodeData["rate"] = stream.str(); nodeData["rate"] = stream.str();
stream.str(std::string()); // Clear stringstream stream.str(std::string()); // Clear stringstream
ValueType dormancy = be->passiveFailureRate() / be->activeFailureRate();
stream << dormancy;
stream << be->dormancyFactor();
nodeData["dorm"] = stream.str(); nodeData["dorm"] = stream.str();
} else { } else {
STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "Element of type '" << element->type() << "' is not supported."); STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "Element of type '" << element->type() << "' is not supported.");

9
src/storm-dft/storage/dft/elements/DFTBE.h

@ -34,6 +34,15 @@ namespace storm {
return mPassiveFailureRate; return mPassiveFailureRate;
} }
ValueType dormancyFactor() const {
if (storm::utility::isZero<ValueType>(this->activeFailureRate())) {
// Return default value of 0
return storm::utility::zero<ValueType>();
} else {
return this->passiveFailureRate() / this->activeFailureRate();
}
}
bool isTransient() const { bool isTransient() const {
return mTransient; return mTransient;
} }

Loading…
Cancel
Save