Browse Source

Get all model parameters

tempestpy_adaptions
Matthias Volk 6 years ago
parent
commit
3c5f25fe4a
  1. 9
      src/storm/models/sparse/Model.cpp
  2. 20
      src/storm/models/sparse/Model.h

9
src/storm/models/sparse/Model.cpp

@ -473,8 +473,15 @@ namespace storm {
}
return result;
}
std::set<storm::RationalFunctionVariable> getAllParameters(Model<storm::RationalFunction> const& model) {
std::set<storm::RationalFunctionVariable> parameters = getProbabilityParameters(model);
std::set<storm::RationalFunctionVariable> rewardParameters = getRewardParameters(model);
parameters.insert(rewardParameters.begin(), rewardParameters.end());
return parameters;
}
#endif
template class Model<double>;
template class Model<float>;

20
src/storm/models/sparse/Model.h

@ -419,10 +419,28 @@ namespace storm {
boost::optional<std::shared_ptr<storm::storage::sparse::ChoiceOrigins>> choiceOrigins;
};
#ifdef STORM_HAVE_CARL
/*!
* Get all probability parameters occurring on transitions.
* @param model Model.
* @return Set of parameters.
*/
std::set<storm::RationalFunctionVariable> getProbabilityParameters(Model<storm::RationalFunction> const& model);
/*!
* Get all parameters occurring in rewards.
* @param model Model.
* @return Set of parameters.
*/
std::set<storm::RationalFunctionVariable> getRewardParameters(Model<storm::RationalFunction> const& model);
/*!
* Get all parameters (probability and rewards) occurring in the model.
* @param model Model.
* @return Set of parameters.
*/
std::set<storm::RationalFunctionVariable> getAllParameters(Model<storm::RationalFunction> const& model);
#endif
} // namespace sparse
} // namespace models

Loading…
Cancel
Save