From 3cf955312646c9dccb74f8c5e8ad9bbf5a6643d0 Mon Sep 17 00:00:00 2001 From: TimQu Date: Fri, 14 Sep 2018 16:54:01 +0200 Subject: [PATCH] actually fixed model feature support --- src/storm/storage/jani/JSONExporter.cpp | 6 +++++- src/storm/storage/jani/JSONExporter.h | 5 +---- src/storm/storage/jani/ModelFeatures.cpp | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/storm/storage/jani/JSONExporter.cpp b/src/storm/storage/jani/JSONExporter.cpp index 4bfb71e03..ed08b7a98 100644 --- a/src/storm/storage/jani/JSONExporter.cpp +++ b/src/storm/storage/jani/JSONExporter.cpp @@ -1094,6 +1094,10 @@ namespace storm { jsonStruct["properties"] = properties; } - + modernjson::json JsonExporter::finalize() { + jsonStruct["features"] = modernjson::json::parse(modelFeatures.toString()); + return jsonStruct; + } + } } diff --git a/src/storm/storage/jani/JSONExporter.h b/src/storm/storage/jani/JSONExporter.h index 1e6eefb50..0bd1486f2 100644 --- a/src/storm/storage/jani/JSONExporter.h +++ b/src/storm/storage/jani/JSONExporter.h @@ -97,10 +97,7 @@ namespace storm { void convertProperties(std::vector const& formulas, storm::jani::Model const& model); void appendVariableDeclaration(storm::jani::Variable const& variable); - modernjson::json finalize() { - jsonStruct["features"] = modelFeatures.toString(); - return jsonStruct; - } + modernjson::json finalize(); modernjson::json jsonStruct; storm::jani::ModelFeatures modelFeatures; diff --git a/src/storm/storage/jani/ModelFeatures.cpp b/src/storm/storage/jani/ModelFeatures.cpp index 8bb8d6475..8ea1c769b 100644 --- a/src/storm/storage/jani/ModelFeatures.cpp +++ b/src/storm/storage/jani/ModelFeatures.cpp @@ -21,15 +21,16 @@ namespace storm { } std::string ModelFeatures::toString() const { - std::string res; + std::string res = "["; bool first = true; for (auto const& f : features) { if (!first) { res += ", "; } - res += storm::jani::toString(f); + res += "\"" + storm::jani::toString(f) + "\""; first = false; } + res += "]"; return res; }