Browse Source

outcommented code for maximals

Former-commit-id: 096fa39fea
tempestpy_adaptions
sjunges 9 years ago
parent
commit
a28ebac022
  1. 27
      src/models/sparse/StandardRewardModel.cpp
  2. 6
      src/models/sparse/StandardRewardModel.h

27
src/models/sparse/StandardRewardModel.cpp

@ -67,6 +67,20 @@ namespace storm {
this->optionalStateRewardVector.get()[state] = newReward;
}
// template<typename ValueType>
// ValueType StandardRewardModel<ValueType>::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<typename ValueType>
bool StandardRewardModel<ValueType>::hasStateActionRewards() const {
return static_cast<bool>(this->optionalStateActionRewardVector);
@ -99,6 +113,19 @@ namespace storm {
this->optionalStateActionRewardVector.get()[choiceIndex] = newValue;
}
// template<typename ValueType>
// ValueType StandardRewardModel<ValueType>::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<typename ValueType>
boost::optional<std::vector<ValueType>> const& StandardRewardModel<ValueType>::getOptionalStateActionRewardVector() const {
return this->optionalStateActionRewardVector;

6
src/models/sparse/StandardRewardModel.h

@ -79,6 +79,10 @@ namespace storm {
template<typename T>
void setStateReward(uint_fast64_t state, T const& newReward);
//template<typename T=ValueType, EnableIf<hasTotalOrder<T>>>
//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<typename T>
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.
*

Loading…
Cancel
Save