Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
MarkovAutomaton.h
Go to the documentation of this file.
1#pragma once
2
8
9namespace storm {
10namespace models {
11namespace sparse {
12
16template<class ValueType, typename RewardModelType = StandardRewardModel<ValueType>>
17class MarkovAutomaton : public NondeterministicModel<ValueType, RewardModelType> {
18 public:
32 storm::storage::BitVector const& markovianStates,
33 std::unordered_map<std::string, RewardModelType> const& rewardModels = std::unordered_map<std::string, RewardModelType>());
34
48 storm::storage::BitVector&& markovianStates,
49 std::unordered_map<std::string, RewardModelType>&& rewardModels = std::unordered_map<std::string, RewardModelType>());
50
58
61
64
70 bool isClosed() const;
71
78 bool containsZenoCycle() const;
79
87
95
103
109 std::vector<ValueType> const& getExitRates() const;
110
116 std::vector<ValueType>& getExitRates();
117
125
132
139
143 void close();
144
148 bool isConvertibleToCtmc() const;
149
150 bool hasOnlyTrivialNondeterminism() const;
151
157 std::shared_ptr<storm::models::sparse::Ctmc<ValueType, RewardModelType>> convertToCtmc() const;
158
159 virtual void printModelInformationToStream(std::ostream& out) const override;
160
161 private:
168 void turnRatesToProbabilities();
169
173 bool checkIsClosed() const;
174
180 bool checkContainsZenoCycle() const;
181
182 // A bit vector representing the set of Markovian states.
183 storm::storage::BitVector markovianStates;
184
185 // A vector storing the exit rates of all states of the model.
186 std::vector<ValueType> exitRates;
187
188 // A flag indicating whether the Markov automaton has been closed, which is typically a prerequisite for model checking.
189 bool closed;
190
191 // A flag indicating whether the Markov automaton contains Zeno cycles.
192 mutable boost::optional<bool> hasZenoCycle;
193};
194
195// Instantiated in MarkovAutomaton.cpp; prevents hidden consumers from duplicating the vtable/RTTI.
196extern template class MarkovAutomaton<double>;
198extern template class MarkovAutomaton<storm::RationalNumber>;
200extern template class MarkovAutomaton<storm::Interval>;
201extern template class MarkovAutomaton<storm::RationalInterval>;
202extern template class MarkovAutomaton<storm::RationalFunction>;
203
204} // namespace sparse
205} // namespace models
206} // namespace storm
This class represents a Markov automaton.
void close()
Closes the Markov automaton.
MarkovAutomaton(storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::models::sparse::StateLabeling const &stateLabeling, storm::storage::BitVector const &markovianStates, std::unordered_map< std::string, RewardModelType > const &rewardModels=std::unordered_map< std::string, RewardModelType >())
Constructs a model from the given data.
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.
NondeterministicModel(ModelType modelType, storm::storage::sparse::ModelComponents< ValueType, RewardModelType > const &components)
Constructs a model from the given data.
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.