Storm 1.13.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
explicit_models.h
Go to the documentation of this file.
1#pragma once
2
3#include <boost/optional.hpp>
4#include <memory>
5#include <string>
6#include <type_traits>
7
14
15namespace storm::api {
16
17template<typename ValueType>
18inline std::shared_ptr<storm::models::sparse::Model<ValueType>> buildExplicitModel(std::string const& transitionsFile, std::string const& labelingFile,
19 boost::optional<std::string> const& stateRewardsFile,
20 boost::optional<std::string> const& transitionRewardsFile,
21 boost::optional<std::string> const& choiceLabelingFile) {
22 if constexpr (std::is_same_v<ValueType, double>) {
23 return storm::parser::AutoParser<ValueType, ValueType>::parseModel(transitionsFile, labelingFile, stateRewardsFile ? stateRewardsFile.get() : "",
24 transitionRewardsFile ? transitionRewardsFile.get() : "",
25 choiceLabelingFile ? choiceLabelingFile.get() : "");
26 }
27 STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "Exact or parametric models with explicit input are not supported.");
28}
29
30template<typename ValueType>
31std::shared_ptr<storm::models::sparse::Model<ValueType>> buildExplicitDRNModel(
34}
35
36inline std::shared_ptr<storm::models::ModelBase> buildExplicitDRNModel(
39 return storm::parser::parseDirectEncodingModel(drnFile, valueType, options);
40}
41
42inline std::shared_ptr<storm::models::ModelBase> buildExplicitUmbModel(std::string const& umbLocation, storm::umb::ImportOptions const& options = {}) {
43 return storm::umb::buildModelFromUmb(umbLocation, options);
44}
45
46template<typename ValueType>
47std::shared_ptr<storm::models::sparse::Model<ValueType>> buildExplicitIMCAModel(std::string const& imcaFile) {
48 if constexpr (std::is_same_v<ValueType, double>) {
50 }
51 STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "Exact models with direct encoding are not supported.");
52}
53
54} // namespace storm::api
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.
static std::shared_ptr< storm::models::sparse::MarkovAutomaton< ValueType > > parseImcaFile(std::string const &filename)
Parses the given file under the assumption that it contains a Markov automaton specified in the imca ...
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
std::shared_ptr< storm::models::sparse::Model< ValueType > > buildExplicitModel(std::string const &transitionsFile, std::string const &labelingFile, boost::optional< std::string > const &stateRewardsFile, boost::optional< std::string > const &transitionRewardsFile, boost::optional< std::string > const &choiceLabelingFile)
std::shared_ptr< storm::models::ModelBase > buildExplicitUmbModel(std::string const &umbLocation, storm::umb::ImportOptions const &options={})
std::shared_ptr< storm::models::sparse::Model< ValueType > > buildExplicitDRNModel(std::string const &drnFile, storm::parser::DirectEncodingParserOptions const &options=storm::parser::DirectEncodingParserOptions())
std::shared_ptr< storm::models::sparse::Model< ValueType > > buildExplicitIMCAModel(std::string const &imcaFile)
std::shared_ptr< storm::models::sparse::Model< ValueType, RewardModelType > > parseDirectEncodingModel(std::filesystem::path const &file, DirectEncodingParserOptions const &options)
Parses the given file in DRN format.
std::shared_ptr< storm::models::sparse::Model< ValueType > > buildModelFromUmb(std::filesystem::path const &umbLocation, ImportOptions const &options)
Definition Umb.cpp:22