Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
RewardModel.h
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4#include <string>
5#include <vector>
6
11
12namespace storm {
13namespace prism {
15 public:
26 RewardModel(std::string const& rewardModelName, std::vector<storm::prism::StateReward> const& stateRewards,
27 std::vector<storm::prism::StateActionReward> const& stateActionRewards, std::vector<storm::prism::TransitionReward> const& transitionRewards,
28 std::string const& filename = "", uint_fast64_t lineNumber = 0);
29
30 // Create default implementations of constructors/assignment.
31 RewardModel() = default;
32 RewardModel(RewardModel const& other) = default;
33 RewardModel& operator=(RewardModel const& other) = default;
34 RewardModel(RewardModel&& other) = default;
35 RewardModel& operator=(RewardModel&& other) = default;
36
42 std::string const& getName() const;
43
49 bool empty() const;
50
56 bool hasStateRewards() const;
57
63 std::vector<storm::prism::StateReward> const& getStateRewards() const;
64
70 bool hasStateActionRewards() const;
71
77 std::vector<storm::prism::StateActionReward> const& getStateActionRewards() const;
78
84 bool hasTransitionRewards() const;
85
91 std::vector<storm::prism::TransitionReward> const& getTransitionRewards() const;
92
99 RewardModel substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution) const;
100
101 RewardModel labelUnlabelledCommands(std::vector<std::pair<uint64_t, std::string>> const& newActionNames) const;
102
110 bool containsVariablesOnlyInRewardValueExpressions(std::set<storm::expressions::Variable> const& undefinedConstantVariables) const;
111
119
120 friend std::ostream& operator<<(std::ostream& stream, RewardModel const& rewardModel);
121
122 private:
123 // The name of the reward model.
124 std::string rewardModelName;
125
126 // The state-based rewards associated with this reward model.
127 std::vector<storm::prism::StateReward> stateRewards;
128
129 // The state-action-based rewards associated with this reward model.
130 std::vector<storm::prism::StateActionReward> stateActionRewards;
131
132 // The transition-based rewards associated with this reward model.
133 std::vector<storm::prism::TransitionReward> transitionRewards;
134};
135
136} // namespace prism
137} // namespace storm
LocatedInformation(std::string const &filename, uint_fast64_t lineNumber)
Constructs a located information with the given filename and line number.
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(std::string const &rewardModelName, std::vector< storm::prism::StateReward > const &stateRewards, std::vector< storm::prism::StateActionReward > const &stateActionRewards, std::vector< storm::prism::TransitionReward > const &transitionRewards, std::string const &filename="", uint_fast64_t lineNumber=0)
Creates a reward model with the given name, state and transition rewards.
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