15template<storm::dd::DdType Type,
typename ValueType>
20 std::set<storm::expressions::Variable>
const& columnVariables,
21 std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>>
const& rowColumnMetaVariablePairs,
22 std::set<storm::expressions::Variable>
const& nondeterminismVariables, std::map<std::string, storm::expressions::Expression> labelToExpressionMap,
23 std::unordered_map<std::string, RewardModelType>
const& rewardModels)
25 transitionMatrix, rowVariables, rowExpressionAdapter, columnVariables, rowColumnMetaVariablePairs,
26 nondeterminismVariables, labelToExpressionMap, rewardModels),
27 markovianMarker(markovianMarker) {
29 computeMarkovianInfo();
32template<storm::dd::DdType Type,
typename ValueType>
36 std::set<storm::expressions::Variable>
const& rowVariables, std::set<storm::expressions::Variable>
const& columnVariables,
37 std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>>
const& rowColumnMetaVariablePairs,
38 std::set<storm::expressions::Variable>
const& nondeterminismVariables, std::map<std::string,
storm::dd::Bdd<Type>> labelToBddMap,
39 std::unordered_map<std::string, RewardModelType>
const& rewardModels)
41 transitionMatrix, rowVariables, columnVariables, rowColumnMetaVariablePairs, nondeterminismVariables,
42 labelToBddMap, rewardModels),
43 markovianMarker(markovianMarker) {
45 computeMarkovianInfo();
48template<storm::dd::DdType Type,
typename ValueType>
51 this->markovianChoices = this->getQualitativeTransitionMatrix() && this->markovianMarker;
54 std::set<storm::expressions::Variable> columnAndNondeterminsmVariables;
55 std::set_union(this->getColumnVariables().begin(), this->getColumnVariables().end(), this->getNondeterminismVariables().begin(),
56 this->getNondeterminismVariables().end(), std::inserter(columnAndNondeterminsmVariables, columnAndNondeterminsmVariables.begin()));
57 this->probabilisticStates = (this->getQualitativeTransitionMatrix() && !markovianMarker).existsAbstract(columnAndNondeterminsmVariables);
60 this->markovianStates = markovianChoices.existsAbstract(columnAndNondeterminsmVariables);
63 this->exitRateVector = (this->getTransitionMatrix() * this->markovianMarker.template toAdd<ValueType>()).sumAbstract(columnAndNondeterminsmVariables);
67 this->transitionMatrix = this->transitionMatrix / this->markovianChoices.ite(this->exitRateVector, this->getManager().template getAddOne<ValueType>());
70template<storm::dd::DdType Type,
typename ValueType>
72 return this->markovianMarker;
75template<storm::dd::DdType Type,
typename ValueType>
77 return this->markovianStates;
80template<storm::dd::DdType Type,
typename ValueType>
82 return this->markovianChoices;
85template<storm::dd::DdType Type,
typename ValueType>
87 return this->markovianStates;
90template<storm::dd::DdType Type,
typename ValueType>
92 return !(this->probabilisticStates && this->markovianStates).isZero();
95template<storm::dd::DdType Type,
typename ValueType>
97 return !this->hasHybridStates();
100template<storm::dd::DdType Type,
typename ValueType>
104 this->getTransitionMatrix() * (!this->getMarkovianMarker()).
template toAdd<ValueType>(), this->getTransitionMatrix() * this->getExitRateVector());
106 return MarkovAutomaton<Type, ValueType>(this->getManagerAsSharedPointer(), this->getMarkovianMarker(), this->getReachableStates(), this->getInitialStates(),
107 this->getDeadlockStates(), newTransitionMatrix, this->getRowVariables(), this->getRowExpressionAdapter(),
108 this->getColumnVariables(), this->getRowColumnMetaVariablePairs(), this->getNondeterminismVariables(),
109 this->getLabelToExpressionMap(), this->getRewardModels());
112template<storm::dd::DdType Type,
typename ValueType>
114 return this->exitRateVector;
117template<storm::dd::DdType Type,
typename ValueType>
118template<
typename NewValueType>
121 std::unordered_map<std::string, NewRewardModelType> newRewardModels;
123 for (
auto const& e : this->getRewardModels()) {
124 newRewardModels.emplace(e.first, e.second.template toValueType<NewValueType>());
127 auto newLabelToBddMap = this->getLabelToBddMap();
128 newLabelToBddMap.erase(
"init");
129 newLabelToBddMap.erase(
"deadlock");
131 return std::make_shared<MarkovAutomaton<Type, NewValueType>>(
132 this->getManagerAsSharedPointer(), this->getMarkovianMarker(), this->getReachableStates(), this->getInitialStates(), this->getDeadlockStates(),
133 this->getTransitionMatrix().template toValueType<NewValueType>(), this->getRowVariables(), this->getColumnVariables(),
134 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.