Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
StateActionReward.cpp
Go to the documentation of this file.
3
4namespace storm {
5namespace prism {
6StateActionReward::StateActionReward(uint_fast64_t actionIndex, std::string const& actionName, storm::expressions::Expression const& statePredicateExpression,
7 storm::expressions::Expression const& rewardValueExpression, std::string const& filename, uint_fast64_t lineNumber)
8 : LocatedInformation(filename, lineNumber),
9 actionIndex(actionIndex),
10 actionName(actionName),
11 labeled(actionName != ""),
12 statePredicateExpression(statePredicateExpression),
13 rewardValueExpression(rewardValueExpression) {
14 // Nothing to do here.
15}
16
17std::string const& StateActionReward::getActionName() const {
18 return this->actionName;
19}
20
21uint_fast64_t StateActionReward::getActionIndex() const {
22 return this->actionIndex;
23}
24
26 return this->statePredicateExpression;
27}
28
30 return this->rewardValueExpression;
31}
32
34 return labeled;
35}
36
37StateActionReward StateActionReward::substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution) const {
38 return StateActionReward(this->getActionIndex(), this->getActionName(), this->getStatePredicateExpression().substitute(substitution),
39 this->getRewardValueExpression().substitute(substitution), this->getFilename(), this->getLineNumber());
40}
41
42std::ostream& operator<<(std::ostream& stream, StateActionReward const& stateActionReward) {
43 stream << "\t[" << stateActionReward.getActionName() << "] " << stateActionReward.getStatePredicateExpression() << ": "
44 << stateActionReward.getRewardValueExpression() << ";";
45 return stream;
46}
47
48} // namespace prism
49} // namespace storm
uint_fast64_t getLineNumber() const
Retrieves the line number in which the information was found.
std::string const & getFilename() const
Retrieves the name of the file in which the information was found.
std::string const & getActionName() const
Retrieves the action name that is associated with this transition reward.
storm::expressions::Expression const & getRewardValueExpression() const
Retrieves the reward value expression associated with this state reward.
storm::expressions::Expression const & getStatePredicateExpression() const
Retrieves the state predicate expression that is associated with this state reward.
bool isLabeled() const
Retrieves whether the transition reward has an action label.
uint_fast64_t getActionIndex() const
Retrieves the action index of the action associated with this transition reward (if any).
StateActionReward substitute(std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution) const
Substitutes all identifiers in the transition reward according to the given map.
std::ostream & operator<<(std::ostream &stream, Assignment const &assignment)
LabParser.cpp.
Definition cli.cpp:18