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: case ModelType::UNDEFINED:
stream << "undefined"; stream << "undefined";
break; break;
case ModelType::LTS:
stream << "lts";
break;
case ModelType::DTMC: case ModelType::DTMC:
stream << "dtmc"; stream << "dtmc";
break; break;
@ -23,17 +26,32 @@ namespace storm {
case ModelType::MA: case ModelType::MA:
stream << "ma"; stream << "ma";
break; break;
case ModelType::TA:
stream << "ta";
break;
case ModelType::PTA: case ModelType::PTA:
stream << "pta"; stream << "pta";
break; break;
case ModelType::STA: case ModelType::STA:
stream << "sta"; stream << "sta";
break; break;
case ModelType::HA:
stream << "ha";
break;
case ModelType::PHA:
stream << "pha";
break;
case ModelType::SHA:
stream << "sha";
break;
} }
return stream; return stream;
} }
ModelType getModelType(std::string const& input) { ModelType getModelType(std::string const& input) {
if (input == "lts") {
return ModelType::LTS;
}
if (input == "dtmc") { if (input == "dtmc") {
return ModelType::DTMC; return ModelType::DTMC;
} }
@ -49,12 +67,24 @@ namespace storm {
if (input == "ma") { if (input == "ma") {
return ModelType::MA; return ModelType::MA;
} }
if (input == "ta") {
return ModelType::TA;
}
if (input == "pta") { if (input == "pta") {
return ModelType::PTA; return ModelType::PTA;
} }
if (input == "sta") { if (input == "sta") {
return ModelType::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; return ModelType::UNDEFINED;
} }

4
src/storage/jani/ModelType.h

@ -5,7 +5,9 @@
namespace storm { namespace storm {
namespace jani { 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); ModelType getModelType(std::string const& input);
std::ostream& operator<<(std::ostream& stream, ModelType const& type); std::ostream& operator<<(std::ostream& stream, ModelType const& type);

Loading…
Cancel
Save