Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
TransitionReward.h
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4
7
8namespace storm {
9namespace storage {
10namespace expressions {
11class Variable;
12}
13} // namespace storage
14} // namespace storm
15
16namespace storm {
17namespace prism {
19 public:
34 TransitionReward(uint_fast64_t actionIndex, std::string const& actionName, storm::expressions::Expression const& sourceStatePredicateExpression,
35 storm::expressions::Expression const& targetStatePredicateExpression, storm::expressions::Expression const& rewardValueExpression,
36 std::string const& filename = "", uint_fast64_t lineNumber = 0);
37
38 // Create default implementations of constructors/assignment.
39 TransitionReward() = default;
40 TransitionReward(TransitionReward const& other) = default;
44
50 std::string const& getActionName() const;
51
57 uint_fast64_t getActionIndex() const;
58
65
72
79
85 bool isLabeled() const;
86
93 TransitionReward substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution) const;
94
95 friend std::ostream& operator<<(std::ostream& stream, TransitionReward const& transitionReward);
96
97 private:
98 // The index of the action name.
99 uint_fast64_t actionIndex;
100
101 // The name of the command this transition-based reward is attached to.
102 std::string actionName;
103
104 // A flag that stores whether the transition reward has an action label.
105 bool labeled;
106
107 // A predicate that needs to be satisfied in the source state of transitions that can earn the reward.
108 storm::expressions::Expression sourceStatePredicateExpression;
109
110 // A predicate that needs to be satisfied in the target state of transitions that can earn the reward.
111 storm::expressions::Expression targetStatePredicateExpression;
112
113 // The expression specifying the value of the reward obtained along the transitions.
114 storm::expressions::Expression rewardValueExpression;
115};
116
117} // namespace prism
118} // namespace storm
LocatedInformation(std::string const &filename, uint_fast64_t lineNumber)
Constructs a located information with the given filename and line number.
TransitionReward substitute(std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution) const
Substitutes all identifiers in the transition reward according to the given map.
uint_fast64_t getActionIndex() const
Retrieves the action index of the action associated with this transition reward (if any).
TransitionReward(TransitionReward &&other)=default
storm::expressions::Expression const & getRewardValueExpression() const
Retrieves the reward value expression associated with this state reward.
storm::expressions::Expression const & getSourceStatePredicateExpression() const
Retrieves the source state predicate expression that is associated with this state reward.
TransitionReward & operator=(TransitionReward const &other)=default
friend std::ostream & operator<<(std::ostream &stream, TransitionReward const &transitionReward)
TransitionReward(uint_fast64_t actionIndex, std::string const &actionName, storm::expressions::Expression const &sourceStatePredicateExpression, storm::expressions::Expression const &targetStatePredicateExpression, storm::expressions::Expression const &rewardValueExpression, std::string const &filename="", uint_fast64_t lineNumber=0)
Creates a transition reward for the transitions with the given name emanating from states satisfying ...
TransitionReward & operator=(TransitionReward &&other)=default
bool isLabeled() const
Retrieves whether the transition reward has an action label.
storm::expressions::Expression const & getTargetStatePredicateExpression() const
Retrieves the target state predicate expression that is associated with this state reward.
TransitionReward(TransitionReward const &other)=default
std::string const & getActionName() const
Retrieves the action name that is associated with this transition reward.