diff --git a/src/models/sparse/StandardRewardModel.cpp b/src/models/sparse/StandardRewardModel.cpp index 8342a3aaf..a3c9eb491 100644 --- a/src/models/sparse/StandardRewardModel.cpp +++ b/src/models/sparse/StandardRewardModel.cpp @@ -67,6 +67,20 @@ namespace storm { this->optionalStateRewardVector.get()[state] = newReward; } +// template +// ValueType StandardRewardModel::maximalStateReward(uint_fast64_t state) const { +// assert(this->hasStateRewards()); +// assert(!this->optionalStateRewardVector.get().empty()); +// ValueType max = *(this->optionalStateRewardVector.get().begin()); +// for(auto const& entry : this->optionalStateRewardVector.get()) { +// if(entry > max) { +// max = entry; +// } +// } +// return max; +// } + + template bool StandardRewardModel::hasStateActionRewards() const { return static_cast(this->optionalStateActionRewardVector); @@ -99,6 +113,19 @@ namespace storm { this->optionalStateActionRewardVector.get()[choiceIndex] = newValue; } +// template +// ValueType StandardRewardModel::maximalStateActionReward() const { +// assert(this->hasStateActionRewards()); +// assert(!this->optionalStateActionRewardVector.get().empty()); +// ValueType max = *(this->optionalStateActionRewardVector.get().begin()); +// for(auto const& entry : this->optionalStateActionRewardVector.get()) { +// if(entry > max) { +// max = entry; +// } +// } +// return max; +// } + template boost::optional> const& StandardRewardModel::getOptionalStateActionRewardVector() const { return this->optionalStateActionRewardVector; diff --git a/src/models/sparse/StandardRewardModel.h b/src/models/sparse/StandardRewardModel.h index ae6e06bfe..fb8ba4658 100644 --- a/src/models/sparse/StandardRewardModel.h +++ b/src/models/sparse/StandardRewardModel.h @@ -79,6 +79,10 @@ namespace storm { template void setStateReward(uint_fast64_t state, T const& newReward); + + //template>> + //ValueType maximalStateReward(uint_fast64_t state) const; + /*! * Retrieves an optional value that contains the state reward vector if there is one. * @@ -120,6 +124,8 @@ namespace storm { template void setStateActionReward(uint_fast64_t choiceIndex, T const& newValue); + //ValueType maximalStateActionReward() const; + /*! * Retrieves an optional value that contains the state-action reward vector if there is one. *