13template<storm::dd::DdType Type,
typename ValueType>
18 std::set<storm::expressions::Variable>
const& columnVariables,
19 std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>>
const& rowColumnMetaVariablePairs,
20 std::set<storm::expressions::Variable>
const& nondeterminismVariables, std::map<std::string, storm::expressions::Expression> labelToExpressionMap,
21 std::unordered_map<std::string, RewardModelType>
const& rewardModels)
23 transitionMatrix, rowVariables, rowExpressionAdapter, columnVariables, rowColumnMetaVariablePairs,
24 nondeterminismVariables, labelToExpressionMap, rewardModels),
25 markovianMarker(markovianMarker) {
27 computeMarkovianInfo();
30template<storm::dd::DdType Type,
typename ValueType>
34 std::set<storm::expressions::Variable>
const& rowVariables, std::set<storm::expressions::Variable>
const& columnVariables,
35 std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>>
const& rowColumnMetaVariablePairs,
36 std::set<storm::expressions::Variable>
const& nondeterminismVariables, std::map<std::string,
storm::dd::Bdd<Type>> labelToBddMap,
37 std::unordered_map<std::string, RewardModelType>
const& rewardModels)
39 transitionMatrix, rowVariables, columnVariables, rowColumnMetaVariablePairs, nondeterminismVariables,
40 labelToBddMap, rewardModels),
41 markovianMarker(markovianMarker) {
43 computeMarkovianInfo();
46template<storm::dd::DdType Type,
typename ValueType>
49 this->markovianChoices = this->getQualitativeTransitionMatrix() && this->markovianMarker;
52 std::set<storm::expressions::Variable> columnAndNondeterminsmVariables;
53 std::set_union(this->getColumnVariables().begin(), this->getColumnVariables().end(), this->getNondeterminismVariables().begin(),
54 this->getNondeterminismVariables().end(), std::inserter(columnAndNondeterminsmVariables, columnAndNondeterminsmVariables.begin()));
55 this->probabilisticStates = (this->getQualitativeTransitionMatrix() && !markovianMarker).existsAbstract(columnAndNondeterminsmVariables);
58 this->markovianStates = markovianChoices.existsAbstract(columnAndNondeterminsmVariables);
61 this->exitRateVector = (this->getTransitionMatrix() * this->markovianMarker.template toAdd<ValueType>()).sumAbstract(columnAndNondeterminsmVariables);
65 this->transitionMatrix = this->transitionMatrix / this->markovianChoices.ite(this->exitRateVector, this->getManager().template getAddOne<ValueType>());
68template<storm::dd::DdType Type,
typename ValueType>
70 return this->markovianMarker;
73template<storm::dd::DdType Type,
typename ValueType>
75 return this->markovianStates;
78template<storm::dd::DdType Type,
typename ValueType>
80 return this->markovianChoices;
83template<storm::dd::DdType Type,
typename ValueType>
85 return this->markovianStates;
88template<storm::dd::DdType Type,
typename ValueType>
90 return !(this->probabilisticStates && this->markovianStates).isZero();
93template<storm::dd::DdType Type,
typename ValueType>
95 return !this->hasHybridStates();
98template<storm::dd::DdType Type,
typename ValueType>
102 this->getTransitionMatrix() * (!this->getMarkovianMarker()).
template toAdd<ValueType>(), this->getTransitionMatrix() * this->getExitRateVector());
104 return MarkovAutomaton<Type, ValueType>(this->getManagerAsSharedPointer(), this->getMarkovianMarker(), this->getReachableStates(), this->getInitialStates(),
105 this->getDeadlockStates(), newTransitionMatrix, this->getRowVariables(), this->getRowExpressionAdapter(),
106 this->getColumnVariables(), this->getRowColumnMetaVariablePairs(), this->getNondeterminismVariables(),
107 this->getLabelToExpressionMap(), this->getRewardModels());
110template<storm::dd::DdType Type,
typename ValueType>
112 return this->exitRateVector;
115template<storm::dd::DdType Type,
typename ValueType>
116template<
typename NewValueType>
119 std::unordered_map<std::string, NewRewardModelType> newRewardModels;
121 for (
auto const& e : this->getRewardModels()) {
122 newRewardModels.emplace(e.first, e.second.template toValueType<NewValueType>());
125 auto newLabelToBddMap = this->getLabelToBddMap();
126 newLabelToBddMap.erase(
"init");
127 newLabelToBddMap.erase(
"deadlock");
129 return std::make_shared<MarkovAutomaton<Type, NewValueType>>(
130 this->getManagerAsSharedPointer(), this->getMarkovianMarker(), this->getReachableStates(), this->getInitialStates(), this->getDeadlockStates(),
131 this->getTransitionMatrix().template toValueType<NewValueType>(), this->getRowVariables(), this->getColumnVariables(),
132 this->getRowColumnMetaVariablePairs(), this->getNondeterminismVariables(), newLabelToBddMap, newRewardModels);
This class represents a discrete-time Markov decision process.
storm::dd::Bdd< Type > const & getProbabilisticStates() const
MarkovAutomaton< Type, ValueType > close()
storm::dd::Bdd< Type > const & getMarkovianStates() const
bool hasHybridStates() const
MarkovAutomaton(MarkovAutomaton< Type, ValueType > const &other)=default
storm::dd::Bdd< Type > const & getMarkovianMarker() const
std::shared_ptr< MarkovAutomaton< Type, NewValueType > > toValueType() const
storm::dd::Add< Type, ValueType > const & getExitRateVector() const
storm::dd::Bdd< Type > const & getMarkovianChoices() const
Base class for all nondeterministic symbolic models.