23template<
typename ValueType,
typename RewardValueType>
24std::shared_ptr<storm::models::sparse::Model<ValueType, storm::models::sparse::StandardRewardModel<RewardValueType>>>
26 std::string
const& stateRewardFilename, std::string
const& transitionRewardFilename,
27 std::string
const& choiceLabelingFilename) {
32 std::shared_ptr<storm::models::sparse::Model<ValueType, storm::models::sparse::StandardRewardModel<RewardValueType>>> model;
35 model = std::shared_ptr<storm::models::sparse::Model<ValueType, storm::models::sparse::StandardRewardModel<RewardValueType>>>(
38 transitionRewardFilename, choiceLabelingFilename))));
42 model = std::shared_ptr<storm::models::sparse::Model<ValueType, storm::models::sparse::StandardRewardModel<RewardValueType>>>(
45 transitionRewardFilename, choiceLabelingFilename))));
49 model = std::shared_ptr<storm::models::sparse::Model<ValueType, storm::models::sparse::StandardRewardModel<RewardValueType>>>(
52 transitionRewardFilename, choiceLabelingFilename))));
56 model = std::shared_ptr<storm::models::sparse::Model<ValueType, storm::models::sparse::StandardRewardModel<RewardValueType>>>(
59 transitionsFilename, labelingFilename, stateRewardFilename, transitionRewardFilename, choiceLabelingFilename))));
63 STORM_LOG_WARN(
"Unknown/Unhandled Model Type which cannot be parsed.");
69template<
typename ValueType,
typename RewardValueType>
77 char const* fileData = file.getData();
89 sscanf(filehintBuffer, formatString.c_str(), hint);
91 for (
char* c = hint; *c !=
'\0'; c++) *c = toupper(*c);
94 if (strcmp(hint,
"DTMC") == 0)
96 else if (strcmp(hint,
"CTMC") == 0)
98 else if (strcmp(hint,
"MDP") == 0)
100 else if (strcmp(hint,
"MA") == 0)
103 STORM_LOG_THROW(
false, storm::exceptions::WrongFormatException,
"Unable to find model hint in explicit input.");
109template class AutoParser<double, double>;
111#ifdef STORM_HAVE_CARL
112template class AutoParser<double, storm::Interval>;
#define STORM_PARSER_AUTOPARSER_HINT_LENGTH
This class represents a continuous-time Markov chain.
This class represents a discrete-time Markov chain.
This class represents a Markov automaton.
This class represents a (discrete-time) Markov decision process.
This class automatically chooses the correct parser for the given files and returns the corresponding...
static std::shared_ptr< storm::models::sparse::Model< ValueType, storm::models::sparse::StandardRewardModel< RewardValueType > > > parseModel(std::string const &transitionsFilename, std::string const &labelingFilename, std::string const &stateRewardFilename="", std::string const &transitionRewardFilename="", std::string const &choiceLabelingFilename="")
Checks the given files and parses the model within these files.
Loads a deterministic model (Dtmc or Ctmc) from files.
Opens a file and maps it to memory providing a char* containing the file content.
Loads a labeled Markov automaton from files.
Loads a nondeterministic model (Mdp or Ctmdp) from files.
#define STORM_LOG_WARN(message)
#define STORM_LOG_THROW(cond, exception, message)