Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
StandardRewardModel.h
Go to the documentation of this file.
1#ifndef STORM_MODELS_SYMBOLIC_STANDARDREWARDMODEL_H_
2#define STORM_MODELS_SYMBOLIC_STANDARDREWARDMODEL_H_
3
4#include <set>
5
6#include <boost/optional.hpp>
7
9
10namespace storm {
11namespace dd {
12template<storm::dd::DdType Type, typename ValueType>
13class Add;
14
15template<storm::dd::DdType Type>
16class Bdd;
17} // namespace dd
18
19namespace expressions {
20class Variable;
21}
22
23namespace models {
24namespace symbolic {
25
26template<storm::dd::DdType Type, typename ValueType>
28 public:
36 explicit StandardRewardModel(boost::optional<storm::dd::Add<Type, ValueType>> const& stateRewardVector,
37 boost::optional<storm::dd::Add<Type, ValueType>> const& stateActionRewardVector,
38 boost::optional<storm::dd::Add<Type, ValueType>> const& transitionRewardMatrix);
39
45 bool empty() const;
46
52 bool hasStateRewards() const;
53
59 bool hasOnlyStateRewards() const;
60
68
76
82 boost::optional<storm::dd::Add<Type, ValueType>> const& getOptionalStateRewardVector() const;
83
89 bool hasStateActionRewards() const;
90
98
106
112 boost::optional<storm::dd::Add<Type, ValueType>> const& getOptionalStateActionRewardVector() const;
113
119 bool hasTransitionRewards() const;
120
128
136
142 boost::optional<storm::dd::Add<Type, ValueType>> const& getOptionalTransitionRewardMatrix() const;
143
153 std::set<storm::expressions::Variable> const& columnVariables) const;
154
166 storm::dd::Add<Type, ValueType> const& transitionMatrix,
167 std::set<storm::expressions::Variable> const& columnVariables) const;
168
181 storm::dd::Add<Type, ValueType> const& choiceFilterAdd,
182 storm::dd::Add<Type, ValueType> const& transitionMatrix,
183 std::set<storm::expressions::Variable> const& columnVariables) const;
184
197 std::set<storm::expressions::Variable> const& columnVariables,
198 storm::dd::Add<Type, ValueType> const& weights, bool scaleTransAndActions) const;
199
206
214
223 void reduceToStateBasedRewards(storm::dd::Add<Type, ValueType> const& transitionMatrix, std::set<storm::expressions::Variable> const& rowVariables,
224 std::set<storm::expressions::Variable> const& columnVariables, bool reduceToStateRewards);
225
226 template<typename NewValueType>
228
229 private:
230 // The state reward vector.
231 boost::optional<storm::dd::Add<Type, ValueType>> optionalStateRewardVector;
232
233 // A vector of state-action-based rewards.
234 boost::optional<storm::dd::Add<Type, ValueType>> optionalStateActionRewardVector;
235
236 // A matrix of transition rewards.
237 boost::optional<storm::dd::Add<Type, ValueType>> optionalTransitionRewardMatrix;
238};
239
240} // namespace symbolic
241} // namespace models
242} // namespace storm
243
244#endif /* STORM_MODELS_SYMBOLIC_STANDARDREWARDMODEL_H_ */
boost::optional< storm::dd::Add< Type, ValueType > > const & getOptionalStateRewardVector() const
Retrieves an optional value that contains the state reward vector if there is one.
storm::dd::Add< Type, ValueType > const & getStateActionRewardVector() const
Retrieves the state-action rewards of the reward model.
boost::optional< storm::dd::Add< Type, ValueType > > const & getOptionalStateActionRewardVector() const
Retrieves an optional value that contains the state-action reward vector if there is one.
bool hasOnlyStateRewards() const
Retrieves whether the reward model only has state rewards (and hence no other rewards).
void reduceToStateBasedRewards(storm::dd::Add< Type, ValueType > const &transitionMatrix, std::set< storm::expressions::Variable > const &rowVariables, std::set< storm::expressions::Variable > const &columnVariables, bool reduceToStateRewards)
Reduces the transition-based rewards to state-action rewards by taking the average of each row.
bool hasStateRewards() const
Retrieves whether the reward model has state rewards.
storm::dd::Add< Type, ValueType > getTotalRewardVector(storm::dd::Add< Type, ValueType > const &transitionMatrix, std::set< storm::expressions::Variable > const &columnVariables) const
Creates a vector representing the complete reward vector based on the state-, state-action- and trans...
storm::dd::Add< Type, ValueType > const & getTransitionRewardMatrix() const
Retrieves the transition rewards of the reward model.
bool empty() const
Retrieves whether the reward model is empty.
storm::dd::Add< Type, ValueType > const & getStateRewardVector() const
Retrieves the state rewards of the reward model.
bool hasStateActionRewards() const
Retrieves whether the reward model has state-action rewards.
boost::optional< storm::dd::Add< Type, ValueType > > const & getOptionalTransitionRewardMatrix() const
Retrieves an optional value that contains the transition reward matrix if there is one.
StandardRewardModel< Type, ValueType > & operator*=(storm::dd::Add< Type, ValueType > const &filter)
Multiplies all components of the reward model with the given DD.
bool hasTransitionRewards() const
Retrieves whether the reward model has transition rewards.
StandardRewardModel< Type, ValueType > divideStateRewardVector(storm::dd::Add< Type, ValueType > const &divisor) const
Divides the state reward vector of the reward model by the given divisor.
StandardRewardModel< Type, NewValueType > toValueType() const
SFTBDDChecker::Bdd Bdd
LabParser.cpp.
Definition cli.cpp:18