10template<
typename ValueType,
typename RewardModelType>
12 std::unordered_map<std::string, RewardModelType>
const& rewardModels)
17template<
typename ValueType,
typename RewardModelType>
19 std::unordered_map<std::string, RewardModelType>&& rewardModels)
25template<
typename ValueType,
typename RewardModelType>
40template<
typename ValueType,
typename RewardModelType>
43 if (components.exitRates) {
44 exitRates = std::move(components.exitRates.get());
46 STORM_LOG_ASSERT(components.rateTransitions,
"No rate information given for CTMC.");
50 if (!components.rateTransitions) {
55template<
typename ValueType,
typename RewardModelType>
60template<
typename ValueType,
typename RewardModelType>
65template<
typename ValueType,
typename RewardModelType>
67 std::vector<ValueType> exitRates(rateMatrix.
getRowCount());
68 for (uint_fast64_t row = 0; row < rateMatrix.
getRowCount(); ++row) {
69 exitRates[row] = rateMatrix.
getRowSum(row);
74template<
typename ValueType,
typename RewardModelType>
76 for (
auto& rewardModel : this->getRewardModels()) {
77 rewardModel.second.reduceToStateBasedRewards(this->getTransitionMatrix(),
true, &exitRates);
81template<
typename ValueType,
typename RewardModelType>
85 for (uint_fast64_t row = 0; row < result.
getRowCount(); ++row) {
86 for (
auto& entry : result.
getRow(row)) {
87 entry.setValue(entry.getValue() / exitRates[row]);
This class represents a continuous-time Markov chain.
storm::storage::SparseMatrix< ValueType > computeProbabilityMatrix() const
virtual void reduceToStateBasedRewards() override
Converts the transition rewards of all reward models to state-based rewards.
Ctmc(storm::storage::SparseMatrix< ValueType > const &rateMatrix, storm::models::sparse::StateLabeling const &stateLabeling, std::unordered_map< std::string, RewardModelType > const &rewardModels=std::unordered_map< std::string, RewardModelType >())
Constructs a model from the given data.
std::vector< ValueType > const & getExitRateVector() const
Retrieves the vector of exit rates of the model.
The base class of all sparse deterministic models.
storm::storage::SparseMatrix< ValueType > const & getTransitionMatrix() const
Retrieves the matrix representing the transitions of the model.
CRewardModelType RewardModelType
This class manages the labeling of the state space with a number of (atomic) labels.
A class that holds a possibly non-square matrix in the compressed row storage format.
const_rows getRow(index_type row) const
Returns an object representing the given row.
value_type getRowSum(index_type row) const
Computes the sum of the entries in a given row.
index_type getRowCount() const
Returns the number of rows of the matrix.
#define STORM_LOG_ASSERT(cond, message)
boost::optional< std::vector< ValueType > > exitRates