18template<
typename ValueType,
typename RewardValueType>
20NondeterministicModelParser<ValueType, RewardValueType>::parseNondeterministicModel(std::string
const& transitionsFilename, std::string
const& labelingFilename,
21 std::string
const& stateRewardFilename,
22 std::string
const& transitionRewardFilename,
23 std::string
const& choiceLabelingFilename) {
28 uint_fast64_t stateCount = transitions.getColumnCount();
38 std::optional<std::vector<RewardValueType>> stateRewards;
39 if (!stateRewardFilename.empty()) {
44 std::optional<storm::storage::SparseMatrix<RewardValueType>> transitionRewards;
45 if (!transitionRewardFilename.empty()) {
47 transitionRewardFilename, result.transitionMatrix));
50 if (stateRewards || transitionRewards) {
51 result.rewardModels.insert(std::make_pair(
56 std::optional<storm::models::sparse::ChoiceLabeling> choiceLabeling;
57 if (!choiceLabelingFilename.empty()) {
59 result.transitionMatrix.getRowGroupIndices());
65template<
typename ValueType,
typename RewardValueType>
68 std::string
const& stateRewardFilename, std::string
const& transitionRewardFilename,
69 std::string
const& choiceLabelingFilename) {
71 parseNondeterministicModel(transitionsFilename, labelingFilename, stateRewardFilename, transitionRewardFilename, choiceLabelingFilename);
This class represents a (discrete-time) Markov decision process.
This class manages the labeling of the state space with a number of (atomic) labels.
Loads a nondeterministic model (Mdp or Ctmdp) from files.
static storm::models::sparse::Mdp< ValueType, storm::models::sparse::StandardRewardModel< RewardValueType > > parseMdp(std::string const &transitionsFilename, std::string const &labelingFilename, std::string const &stateRewardFilename="", std::string const &transitionRewardFilename="", std::string const &choiceLabelingFilename="")
Parse a Mdp.
A class providing the functionality to parse the transitions of a nondeterministic model.
static storm::models::sparse::ChoiceLabeling parseChoiceLabeling(uint_fast64_t choiceCount, std::string const &filename, boost::optional< std::vector< uint_fast64_t > > const &nondeterministicChoiceIndices=boost::none)
Parses the given file and returns the resulting choice labeling.
static storm::models::sparse::StateLabeling parseAtomicPropositionLabeling(uint_fast64_t stateCount, std::string const &filename)
Parses the given file and returns the resulting state labeling.
A class providing the functionality to parse a the state rewards of a model.
A class that holds a possibly non-square matrix in the compressed row storage format.