Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
RewardModel.h
Go to the documentation of this file.
1#ifndef STORM_STORAGE_PRISM_REWARDMODEL_H_
2#define STORM_STORAGE_PRISM_REWARDMODEL_H_
3
4#include <map>
5#include <string>
6#include <vector>
7
13
14namespace storm {
15namespace prism {
17 public:
28 RewardModel(std::string const& rewardModelName, std::vector<storm::prism::StateReward> const& stateRewards,
29 std::vector<storm::prism::StateActionReward> const& stateActionRewards, std::vector<storm::prism::TransitionReward> const& transitionRewards,
30 std::string const& filename = "", uint_fast64_t lineNumber = 0);
31
32 // Create default implementations of constructors/assignment.
33 RewardModel() = default;
34 RewardModel(RewardModel const& other) = default;
35 RewardModel& operator=(RewardModel const& other) = default;
36 RewardModel(RewardModel&& other) = default;
37 RewardModel& operator=(RewardModel&& other) = default;
38
44 std::string const& getName() const;
45
51 bool empty() const;
52
58 bool hasStateRewards() const;
59
65 std::vector<storm::prism::StateReward> const& getStateRewards() const;
66
72 bool hasStateActionRewards() const;
73
79 std::vector<storm::prism::StateActionReward> const& getStateActionRewards() const;
80
86 bool hasTransitionRewards() const;
87
93 std::vector<storm::prism::TransitionReward> const& getTransitionRewards() const;
94
101 RewardModel substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution) const;
102
103 RewardModel labelUnlabelledCommands(std::vector<std::pair<uint64_t, std::string>> const& newActionNames) const;
104
112 bool containsVariablesOnlyInRewardValueExpressions(std::set<storm::expressions::Variable> const& undefinedConstantVariables) const;
113
121
122 friend std::ostream& operator<<(std::ostream& stream, RewardModel const& rewardModel);
123
124 private:
125 // The name of the reward model.
126 std::string rewardModelName;
127
128 // The state-based rewards associated with this reward model.
129 std::vector<storm::prism::StateReward> stateRewards;
130
131 // The state-action-based rewards associated with this reward model.
132 std::vector<storm::prism::StateActionReward> stateActionRewards;
133
134 // The transition-based rewards associated with this reward model.
135 std::vector<storm::prism::TransitionReward> transitionRewards;
136};
137
138} // namespace prism
139} // namespace storm
140
141#endif /* STORM_STORAGE_PRISM_REWARDMODEL_H_ */
std::vector< storm::prism::StateReward > const & getStateRewards() const
Retrieves all state rewards associated with this reward model.
bool hasStateRewards() const
Retrieves whether there are any state rewards.
RewardModel & operator=(RewardModel const &other)=default
RewardModel labelUnlabelledCommands(std::vector< std::pair< uint64_t, std::string > > const &newActionNames) const
friend std::ostream & operator<<(std::ostream &stream, RewardModel const &rewardModel)
RewardModel substitute(std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution) const
Substitutes all variables in the reward model according to the given map.
bool containsVariablesOnlyInRewardValueExpressions(std::set< storm::expressions::Variable > const &undefinedConstantVariables) const
Checks whether any of the given variables only appear in the expressions defining the reward value.
bool hasTransitionRewards() const
Retrieves whether there are any transition rewards.
RewardModel restrictActionRelatedRewards(storm::storage::FlatSet< uint_fast64_t > const &actionIndicesToKeep) const
Restricts all action-related rewards of the reward model to the ones with an action index in the prov...
RewardModel & operator=(RewardModel &&other)=default
RewardModel(RewardModel &&other)=default
std::vector< storm::prism::TransitionReward > const & getTransitionRewards() const
Retrieves all transition rewards associated with this reward model.
std::string const & getName() const
Retrieves the name of the reward model.
bool empty() const
Checks whether the reward model is empty, i.e.
bool hasStateActionRewards() const
Retrieves whether there are any state-action rewards.
RewardModel(RewardModel const &other)=default
std::vector< storm::prism::StateActionReward > const & getStateActionRewards() const
Retrieves all state-action rewards associated with this reward model.
boost::container::flat_set< Key, std::less< Key >, boost::container::new_allocator< Key > > FlatSet
Redefinition of flat_set was needed, because from Boost 1.70 on the default allocator is set to void.
Definition BoostTypes.h:13
LabParser.cpp.
Definition cli.cpp:18