Browse Source

added isParametric to models

Former-commit-id: dc2189b013
tempestpy_adaptions
sjunges 9 years ago
parent
commit
9b9bbe2a68
  1. 4
      src/models/ModelBase.cpp
  2. 5
      src/models/ModelBase.h
  3. 7
      src/models/sparse/Model.cpp
  4. 1
      src/models/sparse/Model.h

4
src/models/ModelBase.cpp

@ -17,5 +17,9 @@ namespace storm {
bool ModelBase::isOfType(storm::models::ModelType const& modelType) const {
return this->getType() == modelType;
}
bool ModelBase::isParametric() const {
return false;
}
}
}

5
src/models/ModelBase.h

@ -97,6 +97,11 @@ namespace storm {
*/
bool isOfType(storm::models::ModelType const& modelType) const;
/*!
* Checks whether the model is parametric
*/
virtual bool isParametric() const;
private:
// The type of the model.
ModelType modelType;

7
src/models/sparse/Model.cpp

@ -310,6 +310,11 @@ namespace storm {
return true;
}
template<typename ValueType, typename RewardModelType>
bool Model<ValueType, RewardModelType>::isParametric() const {
return std::is_same<ValueType, storm::RationalFunction>::value;
}
template<typename ValueType, typename RewardModelType>
std::unordered_map<std::string, RewardModelType>& Model<ValueType, RewardModelType>::getRewardModels() {
return this->rewardModels;
@ -319,6 +324,8 @@ namespace storm {
std::unordered_map<std::string, RewardModelType> const& Model<ValueType, RewardModelType>::getRewardModels() const {
return this->rewardModels;
}
std::set<storm::Variable> getProbabilityParameters(Model<storm::RationalFunction> const& model) {
return storm::storage::getVariables(model.getTransitionMatrix());

1
src/models/sparse/Model.h

@ -278,6 +278,7 @@ namespace storm {
virtual bool isSparseModel() const override;
virtual bool isParametric() const override;
protected:
RewardModelType & rewardModel(std::string const& rewardModelName);

Loading…
Cancel
Save