Browse Source

parse support for all model types (mostly allows better error messages)

Former-commit-id: cd30340c85 [formerly b824493aca]
Former-commit-id: 292217d026
tempestpy_adaptions
sjunges 8 years ago
parent
commit
23122816ef
  1. 30
      src/storage/jani/ModelType.cpp
  2. 4
      src/storage/jani/ModelType.h

30
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;
}

4
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);

Loading…
Cancel
Save