Storm 1.10.0.1
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
12
13namespace storm {
14namespace prism {
16 public:
27 RewardModel(std::string const& rewardModelName, std::vector<storm::prism::StateReward> const& stateRewards,
28 std::vector<storm::prism::StateActionReward> const& stateActionRewards, std::vector<storm::prism::TransitionReward> const& transitionRewards,
29 std::string const& filename = "", uint_fast64_t lineNumber = 0);
30
31 // Create default implementations of constructors/assignment.
32 RewardModel() = default;
33 RewardModel(RewardModel const& other) = default;
34 RewardModel& operator=(RewardModel const& other) = default;
35 RewardModel(RewardModel&& other) = default;
36 RewardModel& operator=(RewardModel&& other) = default;
37
43 std::string const& getName() const;
44
50 bool empty() const;
51
57 bool hasStateRewards() const;
58
64 std::vector<storm::prism::StateReward> const& getStateRewards() const;
65
71 bool hasStateActionRewards() const;
72
78 std::vector<storm::prism::StateActionReward> const& getStateActionRewards() const;
79
85 bool hasTransitionRewards() const;
86
92 std::vector<storm::prism::TransitionReward> const& getTransitionRewards() const;
93
100 RewardModel substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution) const;
101
102 RewardModel labelUnlabelledCommands(std::vector<std::pair<uint64_t, std::string>> const& newActionNames) const;
103
111 bool containsVariablesOnlyInRewardValueExpressions(std::set<storm::expressions::Variable> const& undefinedConstantVariables) const;
112
120
121 friend std::ostream& operator<<(std::ostream& stream, RewardModel const& rewardModel);
122
123 private:
124 // The name of the reward model.
125 std::string rewardModelName;
126
127 // The state-based rewards associated with this reward model.
128 std::vector<storm::prism::StateReward> stateRewards;
129
130 // The state-action-based rewards associated with this reward model.
131 std::vector<storm::prism::StateActionReward> stateActionRewards;
132
133 // The transition-based rewards associated with this reward model.
134 std::vector<storm::prism::TransitionReward> transitionRewards;
135};
136
137} // namespace prism
138} // namespace storm
139
140#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.