From 23122816ef3bd4e1d96a72a4f603278c0b55ad56 Mon Sep 17 00:00:00 2001 From: sjunges Date: Sun, 7 Aug 2016 18:33:34 +0200 Subject: [PATCH] parse support for all model types (mostly allows better error messages) Former-commit-id: cd30340c8519c359b7fa5901749e70d8767d9416 [formerly b824493acaba07b6d0d83123e0a5f441fed2ecc8] Former-commit-id: 292217d02668e2face34be77855db8f3cdad2789 --- src/storage/jani/ModelType.cpp | 30 ++++++++++++++++++++++++++++++ src/storage/jani/ModelType.h | 4 +++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/storage/jani/ModelType.cpp b/src/storage/jani/ModelType.cpp index 68f974786..c1cad45d2 100644 --- a/src/storage/jani/ModelType.cpp +++ b/src/storage/jani/ModelType.cpp @@ -8,6 +8,9 @@ namespace storm { case ModelType::UNDEFINED: stream << "undefined"; break; + case ModelType::LTS: + stream << "lts"; + break; case ModelType::DTMC: stream << "dtmc"; break; @@ -23,17 +26,32 @@ namespace storm { case ModelType::MA: stream << "ma"; break; + case ModelType::TA: + stream << "ta"; + break; case ModelType::PTA: stream << "pta"; break; case ModelType::STA: stream << "sta"; break; + case ModelType::HA: + stream << "ha"; + break; + case ModelType::PHA: + stream << "pha"; + break; + case ModelType::SHA: + stream << "sha"; + break; } return stream; } ModelType getModelType(std::string const& input) { + if (input == "lts") { + return ModelType::LTS; + } if (input == "dtmc") { return ModelType::DTMC; } @@ -49,12 +67,24 @@ namespace storm { if (input == "ma") { return ModelType::MA; } + if (input == "ta") { + return ModelType::TA; + } if (input == "pta") { return ModelType::PTA; } if (input == "sta") { return ModelType::STA; } + if (input == "ha") { + return ModelType::HA; + } + if (input == "pha") { + return ModelType::PHA; + } + if (input == "sha") { + return ModelType::SHA; + } return ModelType::UNDEFINED; } diff --git a/src/storage/jani/ModelType.h b/src/storage/jani/ModelType.h index b6bebae32..7bee93e8c 100644 --- a/src/storage/jani/ModelType.h +++ b/src/storage/jani/ModelType.h @@ -5,7 +5,9 @@ namespace storm { namespace jani { - enum class ModelType {UNDEFINED = 0, DTMC = 1, CTMC = 2, MDP = 3, CTMDP = 4, MA = 5, PTA = 6, STA = 7}; + enum class ModelType {UNDEFINED = 0, LTS=1, DTMC = 2, CTMC = 3, MDP = 4, + CTMDP = 5, MA = 6, TA = 7, PTA = 8, STA = 9, + HA = 10, PHA = 11, SHA = 12}; ModelType getModelType(std::string const& input); std::ostream& operator<<(std::ostream& stream, ModelType const& type);