Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm::prism::RewardModel Class Reference

#include <RewardModel.h>

Inheritance diagram for storm::prism::RewardModel:
Collaboration diagram for storm::prism::RewardModel:

Public Member Functions

 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 ()=default
 
 RewardModel (RewardModel const &other)=default
 
RewardModeloperator= (RewardModel const &other)=default
 
 RewardModel (RewardModel &&other)=default
 
RewardModeloperator= (RewardModel &&other)=default
 
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 hasStateRewards () const
 Retrieves whether there are any state rewards.
 
std::vector< storm::prism::StateReward > const & getStateRewards () const
 Retrieves all state rewards associated with this reward model.
 
bool hasStateActionRewards () const
 Retrieves whether there are any state-action rewards.
 
std::vector< storm::prism::StateActionReward > const & getStateActionRewards () const
 Retrieves all state-action rewards associated with this reward model.
 
bool hasTransitionRewards () const
 Retrieves whether there are any transition rewards.
 
std::vector< storm::prism::TransitionReward > const & getTransitionRewards () const
 Retrieves all transition rewards associated with this reward model.
 
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.
 
RewardModel labelUnlabelledCommands (std::vector< std::pair< uint64_t, std::string > > const &newActionNames) const
 
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.
 
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 provided set.
 
- Public Member Functions inherited from storm::prism::LocatedInformation
 LocatedInformation (std::string const &filename, uint_fast64_t lineNumber)
 Constructs a located information with the given filename and line number.
 
 LocatedInformation ()=default
 
 LocatedInformation (LocatedInformation const &other)=default
 
LocatedInformationoperator= (LocatedInformation const &other)=default
 
 LocatedInformation (LocatedInformation &&other)=default
 
LocatedInformationoperator= (LocatedInformation &&other)=default
 
std::string const & getFilename () const
 Retrieves the name of the file in which the information was found.
 
void setFilename (std::string const &filename)
 Sets the filename of this information.
 
uint_fast64_t getLineNumber () const
 Retrieves the line number in which the information was found.
 
void setLineNumber (uint_fast64_t lineNumber)
 Sets the line number of this information.
 

Friends

std::ostream & operator<< (std::ostream &stream, RewardModel const &rewardModel)
 

Detailed Description

Definition at line 16 of file RewardModel.h.

Constructor & Destructor Documentation

◆ RewardModel() [1/4]

storm::prism::RewardModel::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.

Parameters
rewardModelNameThe name of the reward model.
stateRewardsA vector of state-based rewards.
stateActionRewardsA vector of state-action-based rewards.
transitionRewardsA vector of transition-based rewards.
filenameThe filename in which the reward model is defined.
lineNumberThe line number in which the reward model is defined.

Definition at line 5 of file RewardModel.cpp.

◆ RewardModel() [2/4]

storm::prism::RewardModel::RewardModel ( )
default

◆ RewardModel() [3/4]

storm::prism::RewardModel::RewardModel ( RewardModel const &  other)
default

◆ RewardModel() [4/4]

storm::prism::RewardModel::RewardModel ( RewardModel &&  other)
default

Member Function Documentation

◆ containsVariablesOnlyInRewardValueExpressions()

bool storm::prism::RewardModel::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.

Parameters
undefinedConstantVariablesA set of variables that may only appear in the expressions defining the reward values.
Returns
True iff the given variables only appear in the expressions defining the reward value.

Definition at line 69 of file RewardModel.cpp.

◆ empty()

bool storm::prism::RewardModel::empty ( ) const

Checks whether the reward model is empty, i.e.

contains no state or transition rewards.

Returns
True iff the reward model is empty.

Definition at line 20 of file RewardModel.cpp.

◆ getName()

std::string const & storm::prism::RewardModel::getName ( ) const

Retrieves the name of the reward model.

Returns
The name of the reward model.

Definition at line 16 of file RewardModel.cpp.

◆ getStateActionRewards()

std::vector< storm::prism::StateActionReward > const & storm::prism::RewardModel::getStateActionRewards ( ) const

Retrieves all state-action rewards associated with this reward model.

Returns
The state-action rewards associated with this reward model.

Definition at line 36 of file RewardModel.cpp.

◆ getStateRewards()

std::vector< storm::prism::StateReward > const & storm::prism::RewardModel::getStateRewards ( ) const

Retrieves all state rewards associated with this reward model.

Returns
The state rewards associated with this reward model.

Definition at line 28 of file RewardModel.cpp.

◆ getTransitionRewards()

std::vector< storm::prism::TransitionReward > const & storm::prism::RewardModel::getTransitionRewards ( ) const

Retrieves all transition rewards associated with this reward model.

Returns
The transition rewards associated with this reward model.

Definition at line 44 of file RewardModel.cpp.

◆ hasStateActionRewards()

bool storm::prism::RewardModel::hasStateActionRewards ( ) const

Retrieves whether there are any state-action rewards.

Returns
True iff there are any state-action rewards.

Definition at line 32 of file RewardModel.cpp.

◆ hasStateRewards()

bool storm::prism::RewardModel::hasStateRewards ( ) const

Retrieves whether there are any state rewards.

Returns
True iff there are any state rewards.

Definition at line 24 of file RewardModel.cpp.

◆ hasTransitionRewards()

bool storm::prism::RewardModel::hasTransitionRewards ( ) const

Retrieves whether there are any transition rewards.

Returns
True iff there are any transition rewards.

Definition at line 40 of file RewardModel.cpp.

◆ labelUnlabelledCommands()

RewardModel storm::prism::RewardModel::labelUnlabelledCommands ( std::vector< std::pair< uint64_t, std::string > > const &  newActionNames) const

Definition at line 109 of file RewardModel.cpp.

◆ operator=() [1/2]

RewardModel & storm::prism::RewardModel::operator= ( RewardModel &&  other)
default

◆ operator=() [2/2]

RewardModel & storm::prism::RewardModel::operator= ( RewardModel const &  other)
default

◆ restrictActionRelatedRewards()

RewardModel storm::prism::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 provided set.

Parameters
actionIndicesToKeepThe set of action indices to keep.
Returns
The resulting reward model.

Definition at line 91 of file RewardModel.cpp.

◆ substitute()

RewardModel storm::prism::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.

Parameters
substitutionThe substitution to perform.
Returns
The resulting reward model.

Definition at line 48 of file RewardModel.cpp.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  stream,
RewardModel const &  rewardModel 
)
friend

Definition at line 129 of file RewardModel.cpp.


The documentation for this class was generated from the following files: