Browse Source

Added convenience methods RewardModel::hasStateRewards() and RewardModel::hasTransitionRewards()

main
gereon 12 years ago
parent
commit
d9e833680a
  1. 8
      src/ir/RewardModel.cpp
  2. 12
      src/ir/RewardModel.h

8
src/ir/RewardModel.cpp

@ -37,10 +37,18 @@ std::string RewardModel::toString() const {
return result.str(); return result.str();
} }
bool RewardModel::hasStateRewards() const {
return this->stateRewards.size() > 0;
}
std::vector<storm::ir::StateReward> RewardModel::getStateRewards() const { std::vector<storm::ir::StateReward> RewardModel::getStateRewards() const {
return this->stateRewards; return this->stateRewards;
} }
bool RewardModel::hasTransitionRewards() const {
return this->transitionRewards.size() > 0;
}
std::vector<storm::ir::TransitionReward> RewardModel::getTransitionRewards() const { std::vector<storm::ir::TransitionReward> RewardModel::getTransitionRewards() const {
return this->transitionRewards; return this->transitionRewards;
} }

12
src/ir/RewardModel.h

@ -42,12 +42,24 @@ public:
*/ */
std::string toString() const; std::string toString() const;
/*!
* Check, if there are any state rewards.
* @return True, iff there are any state rewards.
*/
bool hasStateRewards() const;
/*! /*!
* Retrieve state rewards. * Retrieve state rewards.
* @return State rewards. * @return State rewards.
*/ */
std::vector<storm::ir::StateReward> getStateRewards() const; std::vector<storm::ir::StateReward> getStateRewards() const;
/*!
* Check, if there are any transition rewards.
* @return True, iff there are any transition rewards.
*/
bool hasTransitionRewards() const;
/*! /*!
* Retrieve transition rewards. * Retrieve transition rewards.
* @return Transition rewards. * @return Transition rewards.

|||||||
100:0
Loading…
Cancel
Save