17template<
typename ValueType,
typename RewardValueType>
19DeterministicModelParser<ValueType, RewardValueType>::parseDeterministicModel(std::string
const& transitionsFilename, std::string
const& labelingFilename,
20 std::string
const& stateRewardFilename,
21 std::string
const& transitionRewardFilename,
22 std::string
const& choiceLabelingFilename) {
27 uint_fast64_t stateCount = transitions.getColumnCount();
37 std::optional<std::vector<RewardValueType>> stateRewards;
38 if (stateRewardFilename !=
"") {
43 std::optional<storm::storage::SparseMatrix<RewardValueType>> transitionRewards;
44 if (transitionRewardFilename !=
"") {
46 result.transitionMatrix);
49 if (stateRewards || transitionRewards) {
50 result.rewardModels.insert(std::make_pair(
55 std::optional<storm::models::sparse::ChoiceLabeling> choiceLabeling;
56 if (!choiceLabelingFilename.empty()) {
63template<
typename ValueType,
typename RewardValueType>
66 std::string
const& stateRewardFilename, std::string
const& transitionRewardFilename,
67 std::string
const& choiceLabelingFilename) {
68 auto parserResult = parseDeterministicModel(transitionsFilename, labelingFilename, stateRewardFilename, transitionRewardFilename, choiceLabelingFilename);
72template<
typename ValueType,
typename RewardValueType>
75 std::string
const& stateRewardFilename, std::string
const& transitionRewardFilename,
76 std::string
const& choiceLabelingFilename) {
77 auto parserResult = parseDeterministicModel(transitionsFilename, labelingFilename, stateRewardFilename, transitionRewardFilename, choiceLabelingFilename);
78 parserResult.rateTransitions =
true;
This class represents a continuous-time Markov chain.
This class represents a discrete-time Markov chain.
This class manages the labeling of the state space with a number of (atomic) labels.
Loads a deterministic model (Dtmc or Ctmc) from files.
static storm::models::sparse::Ctmc< ValueType, storm::models::sparse::StandardRewardModel< RewardValueType > > parseCtmc(std::string const &transitionsFilename, std::string const &labelingFilename, std::string const &stateRewardFilename="", std::string const &transitionRewardFilename="", std::string const &choiceLabelingFilename="")
Parse a Ctmc.
static storm::models::sparse::Dtmc< ValueType, storm::models::sparse::StandardRewardModel< RewardValueType > > parseDtmc(std::string const &transitionsFilename, std::string const &labelingFilename, std::string const &stateRewardFilename="", std::string const &transitionRewardFilename="", std::string const &choiceLabelingFilename="")
Parse a Dtmc.
This class can be used to parse a file containing either transitions or transition rewards of a deter...
static storm::storage::SparseMatrix< ValueType > parseDeterministicTransitionRewards(std::string const &filename, storm::storage::SparseMatrix< MatrixValueType > const &transitionMatrix)
Load the transition rewards for a deterministic transition system from file and create a sparse adjac...
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.
static std::vector< ValueType > parseSparseStateReward(uint_fast64_t stateCount, std::string const &filename)
Reads a state reward file and puts the result in a state reward vector.
A class that holds a possibly non-square matrix in the compressed row storage format.