From d9e833680aa1d47da845d1881eaa40cb2a415bb8 Mon Sep 17 00:00:00 2001 From: gereon Date: Fri, 15 Mar 2013 15:06:03 +0100 Subject: [PATCH] Added convenience methods RewardModel::hasStateRewards() and RewardModel::hasTransitionRewards() --- src/ir/RewardModel.cpp | 8 ++++++++ src/ir/RewardModel.h | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/ir/RewardModel.cpp b/src/ir/RewardModel.cpp index bd3ce1e16..d6611e4ec 100644 --- a/src/ir/RewardModel.cpp +++ b/src/ir/RewardModel.cpp @@ -37,10 +37,18 @@ std::string RewardModel::toString() const { return result.str(); } +bool RewardModel::hasStateRewards() const { + return this->stateRewards.size() > 0; +} + std::vector RewardModel::getStateRewards() const { return this->stateRewards; } +bool RewardModel::hasTransitionRewards() const { + return this->transitionRewards.size() > 0; +} + std::vector RewardModel::getTransitionRewards() const { return this->transitionRewards; } diff --git a/src/ir/RewardModel.h b/src/ir/RewardModel.h index 5cd7f2767..cb538f173 100644 --- a/src/ir/RewardModel.h +++ b/src/ir/RewardModel.h @@ -42,12 +42,24 @@ public: */ 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. * @return State rewards. */ std::vector getStateRewards() const; + /*! + * Check, if there are any transition rewards. + * @return True, iff there are any transition rewards. + */ + bool hasTransitionRewards() const; + /*! * Retrieve transition rewards. * @return Transition rewards.