Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
MarkovAutomaton.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace storm {
7namespace models {
8namespace sparse {
9
13template<class ValueType, typename RewardModelType = StandardRewardModel<ValueType>>
14class MarkovAutomaton : public NondeterministicModel<ValueType, RewardModelType> {
15 public:
29 storm::storage::BitVector const& markovianStates,
30 std::unordered_map<std::string, RewardModelType> const& rewardModels = std::unordered_map<std::string, RewardModelType>());
31
45 storm::storage::BitVector&& markovianStates,
46 std::unordered_map<std::string, RewardModelType>&& rewardModels = std::unordered_map<std::string, RewardModelType>());
47
55
58
61
67 bool isClosed() const;
68
75 bool containsZenoCycle() const;
76
84
92
100
106 std::vector<ValueType> const& getExitRates() const;
107
113 std::vector<ValueType>& getExitRates();
114
122
129
136
140 void close();
141
145 bool isConvertibleToCtmc() const;
146
147 bool hasOnlyTrivialNondeterminism() const;
148
154 std::shared_ptr<storm::models::sparse::Ctmc<ValueType, RewardModelType>> convertToCtmc() const;
155
156 virtual void printModelInformationToStream(std::ostream& out) const override;
157
158 private:
165 void turnRatesToProbabilities();
166
170 bool checkIsClosed() const;
171
177 bool checkContainsZenoCycle() const;
178
179 // A bit vector representing the set of Markovian states.
180 storm::storage::BitVector markovianStates;
181
182 // A vector storing the exit rates of all states of the model.
183 std::vector<ValueType> exitRates;
184
185 // A flag indicating whether the Markov automaton has been closed, which is typically a prerequisite for model checking.
186 bool closed;
187
188 // A flag indicating whether the Markov automaton contains Zeno cycles.
189 mutable boost::optional<bool> hasZenoCycle;
190};
191
192} // namespace sparse
193} // namespace models
194} // namespace storm
This class represents a Markov automaton.
void close()
Closes the Markov automaton.
bool containsZenoCycle() const
Retrieves whether the Markov automaton contains Zeno cycles.
bool isClosed() const
Retrieves whether the Markov automaton is closed.
std::shared_ptr< storm::models::sparse::Ctmc< ValueType, RewardModelType > > convertToCtmc() const
Convert the MA to a CTMC.
MarkovAutomaton & operator=(MarkovAutomaton< ValueType, RewardModelType > &&other)=default
bool isProbabilisticState(storm::storage::sparse::state_type state) const
Retrieves whether the given state is a probabilistic state.
MarkovAutomaton & operator=(MarkovAutomaton< ValueType, RewardModelType > const &other)=default
bool isMarkovianState(storm::storage::sparse::state_type state) const
Retrieves whether the given state is a Markovian state.
bool isConvertibleToCtmc() const
Determines whether the Markov automaton can be converted to a CTMC without changing any measures.
virtual void printModelInformationToStream(std::ostream &out) const override
Prints information about the model to the specified stream.
std::vector< ValueType > const & getExitRates() const
Retrieves the vector representing the exit rates of the states.
storm::storage::BitVector const & getMarkovianStates() const
Retrieves the set of Markovian states of the model.
ValueType const & getExitRate(storm::storage::sparse::state_type state) const
Retrieves the exit rate of the given state.
ValueType getMaximalExitRate() const
Retrieves the maximal exit rate over all states of the model.
MarkovAutomaton(MarkovAutomaton< ValueType, RewardModelType > const &other)=default
MarkovAutomaton(MarkovAutomaton< ValueType, RewardModelType > &&other)=default
bool isHybridState(storm::storage::sparse::state_type state) const
Retrieves whether the given state is a hybrid state, i.e.
The base class of sparse nondeterministic models.
This class manages the labeling of the state space with a number of (atomic) labels.
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:16
A class that holds a possibly non-square matrix in the compressed row storage format.