From 12c79ad6ea0664a327448dc0960082adf60ebaf2 Mon Sep 17 00:00:00 2001 From: sjunges Date: Sat, 26 Aug 2017 14:51:04 +0200 Subject: [PATCH] export choice labels --- src/storm/utility/DirectEncodingExporter.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/storm/utility/DirectEncodingExporter.cpp b/src/storm/utility/DirectEncodingExporter.cpp index 8c93b3b7f..6bdd629a7 100644 --- a/src/storm/utility/DirectEncodingExporter.cpp +++ b/src/storm/utility/DirectEncodingExporter.cpp @@ -88,7 +88,19 @@ namespace storm { // Iterate over all actions for (typename storm::storage::SparseMatrix::index_type row = start; row < end; ++row) { // Print the actual row. - os << "\taction " << row - start; + if (sparseModel->hasChoiceLabeling()) { + os << "\taction "; + bool lfirst = true; + for (auto const& label : sparseModel->getChoiceLabeling().getLabelsOfChoice(row)) { + if (!lfirst) { + os << "_"; + } + os << label; + lfirst = false; + } + } else { + os << "\taction " << row - start; + } bool first = true; // Write transition rewards for (auto const& rewardModelEntry : sparseModel->getRewardModels()) { @@ -110,11 +122,6 @@ namespace storm { os << "]"; } - // Write choice labeling - if(sparseModel->hasChoiceLabeling()) { - // TODO export choice labeling - STORM_LOG_WARN("Choice labeling was not exported."); - } os << std::endl; // Write probabilities