From 694c87c2b1790719da61bbcecc1c94f03c796267 Mon Sep 17 00:00:00 2001 From: Matthias Volk Date: Thu, 4 Apr 2019 17:23:09 +0200 Subject: [PATCH] Fixed JSON import after changes in BEs --- src/storm-dft/parser/DFTJsonParser.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/storm-dft/parser/DFTJsonParser.cpp b/src/storm-dft/parser/DFTJsonParser.cpp index 1272e033e..7975a0d5b 100644 --- a/src/storm-dft/parser/DFTJsonParser.cpp +++ b/src/storm-dft/parser/DFTJsonParser.cpp @@ -3,8 +3,9 @@ #include #include #include -#include #include +#include + #include "storm/exceptions/NotImplementedException.h" #include "storm/exceptions/FileIoException.h" #include "storm/exceptions/NotSupportedException.h" @@ -87,16 +88,17 @@ namespace storm { success = builder.addSpareElement(name, childNames); } else if (type == "seq") { success = builder.addSequenceEnforcer(name, childNames); - } else if (type== "fdep") { + } else if (type == "fdep") { success = builder.addDepElement(name, childNames, storm::utility::one()); - } else if (type== "pdep") { + } else if (type == "pdep") { ValueType probability = parseRationalExpression(parseJsonNumber(data.at("probability"))); success = builder.addDepElement(name, childNames, probability); - } else if (type == "be") { + } else if (boost::starts_with(type, "be")) { std::string distribution = "exp"; // Set default of exponential distribution if (data.count("distribution") > 0) { distribution = data.at("distribution"); } + STORM_LOG_THROW(type == "be" || "be_" + distribution == type, storm::exceptions::WrongFormatException, "BE type '" << type << "' and distribution '" << distribution << " do not agree."); if (distribution == "exp") { ValueType failureRate = parseRationalExpression(parseJsonNumber(data.at("rate"))); ValueType dormancyFactor = parseRationalExpression(parseJsonNumber(data.at("dorm")));