Browse Source

getRewardModel, private, added

Former-commit-id: 095b135758
tempestpy_adaptions
sjunges 9 years ago
parent
commit
9e24144c27
  1. 8
      src/models/sparse/Model.cpp
  2. 3
      src/models/sparse/Model.h

8
src/models/sparse/Model.cpp

@ -88,7 +88,13 @@ namespace storm {
bool Model<ValueType, RewardModelType>::hasRewardModel(std::string const& rewardModelName) const {
return this->rewardModels.find(rewardModelName) != this->rewardModels.end();
}
template<typename ValueType, typename RewardModelType>
RewardModelType& Model<ValueType, RewardModelType>::getRewardModel(std::string const& rewardModelName) {
assert(this->hasRewardModel(rewardModelName));
return this->rewardModels.find(rewardModelName)->second;
}
template<typename ValueType, typename RewardModelType>
RewardModelType const& Model<ValueType, RewardModelType>::getRewardModel(std::string const& rewardModelName) const {
auto it = this->rewardModels.find(rewardModelName);

3
src/models/sparse/Model.h

@ -154,6 +154,7 @@ namespace storm {
*/
RewardModelType const& getRewardModel(std::string const& rewardModelName) const;
/*!
* Retrieves the unique reward model, if there exists exactly one. Otherwise, an exception is thrown.
*
@ -266,6 +267,8 @@ namespace storm {
virtual bool isSparseModel() const override;
protected:
RewardModelType & getRewardModel(std::string const& rewardModelName);
/*!
* Sets the transition matrix of the model.
*

Loading…
Cancel
Save