From a3aededd3aec9932acef78d0a4c58c8d65a7bdd1 Mon Sep 17 00:00:00 2001 From: TimQu Date: Wed, 9 Mar 2016 13:28:50 +0100 Subject: [PATCH] public access to model ingredients: RewardModel and exitRates Former-commit-id: b8dbe8576eeb3c5a3e78b6046a7c457f326772b6 --- src/models/sparse/MarkovAutomaton.cpp | 5 +++++ src/models/sparse/MarkovAutomaton.h | 7 +++++++ src/models/sparse/Model.h | 29 ++++++++++++++------------- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/models/sparse/MarkovAutomaton.cpp b/src/models/sparse/MarkovAutomaton.cpp index 56a6400d1..983bda12e 100644 --- a/src/models/sparse/MarkovAutomaton.cpp +++ b/src/models/sparse/MarkovAutomaton.cpp @@ -55,6 +55,11 @@ namespace storm { return this->exitRates; } + template + std::vector& MarkovAutomaton::getExitRates() { + return this->exitRates; + } + template ValueType const& MarkovAutomaton::getExitRate(storm::storage::sparse::state_type state) const { return this->exitRates[state]; diff --git a/src/models/sparse/MarkovAutomaton.h b/src/models/sparse/MarkovAutomaton.h index 731b845f3..0556ffa9b 100644 --- a/src/models/sparse/MarkovAutomaton.h +++ b/src/models/sparse/MarkovAutomaton.h @@ -94,6 +94,13 @@ namespace storm { */ std::vector const& getExitRates() const; + /*! + * Retrieves the vector representing the exit rates of the states. + * + * @return The exit rate vector of the model. + */ + std::vector& getExitRates(); + /*! * Retrieves the exit rate of the given state. * diff --git a/src/models/sparse/Model.h b/src/models/sparse/Model.h index dc0378348..a458bdff7 100644 --- a/src/models/sparse/Model.h +++ b/src/models/sparse/Model.h @@ -140,6 +140,21 @@ namespace storm { */ storm::storage::SparseMatrix& getTransitionMatrix(); + + /*! + * Retrieves the reward models. + * + * @return A mapping from reward model names to the reward models. + */ + std::unordered_map const& getRewardModels() const; + + /*! + * Retrieves the reward models. + * + * @return A mapping from reward model names to the reward models. + */ + std::unordered_map& getRewardModels(); + /*! * Retrieves whether the model has a reward model with the given name. * @@ -318,20 +333,6 @@ namespace storm { */ void printRewardModelsInformationToStream(std::ostream& out) const; - /*! - * Retrieves the reward models. - * - * @return A mapping from reward model names to the reward models. - */ - std::unordered_map const& getRewardModels() const; - - /*! - * Retrieves the reward models. - * - * @return A mapping from reward model names to the reward models. - */ - std::unordered_map& getRewardModels(); - private: // A matrix representing transition relation. storm::storage::SparseMatrix transitionMatrix;