Browse Source

Small fixes

tempestpy_adaptions
Matthias Volk 8 years ago
parent
commit
036d9c55d5
  1. 4
      src/storm-dft/builder/ExplicitDFTModelBuilderApprox.cpp
  2. 11
      src/storm-dft/modelchecker/dft/DFTModelChecker.cpp
  3. 2
      src/storm-dft/parser/DFTJsonParser.cpp

4
src/storm-dft/builder/ExplicitDFTModelBuilderApprox.cpp

@ -563,6 +563,10 @@ namespace storm {
if (storm::utility::isZero<ValueType>(rate)) { if (storm::utility::isZero<ValueType>(rate)) {
// Get active failure rate for cold BE // Get active failure rate for cold BE
rate = dft.getBasicElement(id)->activeFailureRate(); rate = dft.getBasicElement(id)->activeFailureRate();
if (storm::utility::isZero<ValueType>(rate)) {
// Ignore BE which cannot fail
continue;
}
// Mark BE as cold // Mark BE as cold
coldBEs.set(i, true); coldBEs.set(i, true);
} }

11
src/storm-dft/modelchecker/dft/DFTModelChecker.cpp

@ -224,7 +224,6 @@ namespace storm {
// Apply bisimulation // Apply bisimulation
bisimulationTimer.start(); bisimulationTimer.start();
composedModel = storm::performDeterministicSparseBisimulationMinimization<storm::models::sparse::Ctmc<ValueType>>(composedModel, {formula}, storm::storage::BisimulationType::Weak)->template as<storm::models::sparse::Ctmc<ValueType>>(); composedModel = storm::performDeterministicSparseBisimulationMinimization<storm::models::sparse::Ctmc<ValueType>>(composedModel, {formula}, storm::storage::BisimulationType::Weak)->template as<storm::models::sparse::Ctmc<ValueType>>();
std::chrono::high_resolution_clock::time_point bisimulationEnd = std::chrono::high_resolution_clock::now();
bisimulationTimer.stop(); bisimulationTimer.stop();
STORM_LOG_INFO("No. states (Composed): " << composedModel->getNumberOfStates()); STORM_LOG_INFO("No. states (Composed): " << composedModel->getNumberOfStates());
@ -412,11 +411,11 @@ namespace storm {
template<typename ValueType> template<typename ValueType>
void DFTModelChecker<ValueType>::printTimings(std::ostream& os) { void DFTModelChecker<ValueType>::printTimings(std::ostream& os) {
os << "Times:" << std::endl; os << "Times:" << std::endl;
os << "Exploration:\t" << explorationTimer.getTimeInSeconds() << "s" << std::endl;
os << "Building:\t" << buildingTimer.getTimeInSeconds() << "s" << std::endl;
os << "Bisimulation:\t" << bisimulationTimer.getTimeInSeconds() << "s" << std::endl;
os << "Modelchecking:\t" << modelCheckingTimer.getTimeInSeconds() << "s" << std::endl;
os << "Total:\t\t" << totalTimer.getTimeInSeconds() << "s" << std::endl;
os << "Exploration:\t" << explorationTimer.getTimeInMilliseconds() / 1000.0 << "s" << std::endl;
os << "Building:\t" << buildingTimer.getTimeInMilliseconds() / 1000.0 << "s" << std::endl;
os << "Bisimulation:\t" << bisimulationTimer.getTimeInMilliseconds() / 1000.0 << "s" << std::endl;
os << "Modelchecking:\t" << modelCheckingTimer.getTimeInMilliseconds() / 1000.0 << "s" << std::endl;
os << "Total:\t\t" << totalTimer.getTimeInMilliseconds() / 1000.0 << "s" << std::endl;
} }
template<typename ValueType> template<typename ValueType>

2
src/storm-dft/parser/DFTJsonParser.cpp

@ -77,6 +77,7 @@ namespace storm {
// Append to id to distinguish elements with the same name // Append to id to distinguish elements with the same name
std::string name = data.at("name"); std::string name = data.at("name");
std::replace(name.begin(), name.end(), ' ', '_'); std::replace(name.begin(), name.end(), ' ', '_');
std::replace(name.begin(), name.end(), '-', '_');
std::stringstream stream; std::stringstream stream;
stream << name << "_" << data.at("id").get<std::string>(); stream << name << "_" << data.at("id").get<std::string>();
name = stream.str(); name = stream.str();
@ -95,6 +96,7 @@ namespace storm {
json data = element.at("data"); json data = element.at("data");
std::string name = data.at("name"); std::string name = data.at("name");
std::replace(name.begin(), name.end(), ' ', '_'); std::replace(name.begin(), name.end(), ' ', '_');
std::replace(name.begin(), name.end(), '-', '_');
std::stringstream stream; std::stringstream stream;
stream << name << "_" << data.at("id").get<std::string>(); stream << name << "_" << data.at("id").get<std::string>();
name = stream.str(); name = stream.str();

Loading…
Cancel
Save