From 0dcfd41f873d99461d448002b63a88b34e176dd2 Mon Sep 17 00:00:00 2001 From: TimQu Date: Thu, 20 Sep 2018 15:10:45 +0200 Subject: [PATCH] fixed appending to existing files in jani export --- src/storm/storage/jani/JSONExporter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/storm/storage/jani/JSONExporter.cpp b/src/storm/storage/jani/JSONExporter.cpp index 7be7799fa..472bc14d5 100644 --- a/src/storm/storage/jani/JSONExporter.cpp +++ b/src/storm/storage/jani/JSONExporter.cpp @@ -742,7 +742,7 @@ namespace storm { void JsonExporter::toFile(storm::jani::Model const& janiModel, std::vector const& formulas, std::string const& filepath, bool checkValid, bool compact) { std::ofstream stream; - storm::utility::openFile(filepath, stream, true); + storm::utility::openFile(filepath, stream, false, true); toStream(janiModel, formulas, stream, checkValid, compact); storm::utility::closeFile(stream); } @@ -1036,6 +1036,9 @@ namespace storm { jsonStruct["type"] = to_string(janiModel.getModelType()); jsonStruct["actions"] = buildActionArray(janiModel.getActions()); jsonStruct["constants"] = buildConstantsArray(janiModel.getConstants()); + for (auto const& v : janiModel.getGlobalVariables()) { + std::cout << "global var " << v.getName() << std::endl; + } jsonStruct["variables"] = buildVariablesArray(janiModel.getGlobalVariables(), janiModel.getConstants(), janiModel.getGlobalVariables()); if (!janiModel.getGlobalFunctionDefinitions().empty()) { jsonStruct["functions"] = buildFunctionsArray(janiModel.getGlobalFunctionDefinitions(), janiModel.getConstants(), janiModel.getGlobalVariables());