Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SparseDeterministicVisitingTimesHelper.h
Go to the documentation of this file.
1#pragma once
2#include <vector>
3
10
11namespace storm {
12class Environment;
13
14namespace modelchecker {
15namespace helper {
16
22template<typename ValueType>
23class SparseDeterministicVisitingTimesHelper : public SingleValueModelCheckerHelper<ValueType, storm::models::ModelRepresentation::Sparse> {
24 public:
28 typedef std::function<ValueType(uint64_t)> ValueGetter;
29
31
36
40 SparseDeterministicVisitingTimesHelper(storm::storage::SparseMatrix<ValueType> const& transitionMatrix, std::vector<ValueType> const& exitRates);
41
48
59
67 std::vector<ExtendedValueType> computeExpectedVisitingTimes(Environment const& env, storm::storage::BitVector const& initialStates);
68
74 std::vector<ExtendedValueType> computeExpectedVisitingTimes(Environment const& env, uint64_t initialState);
75
81 std::vector<ExtendedValueType> computeExpectedVisitingTimes(Environment const& env, ValueGetter const& initialStateValueGetter);
82
89 void computeExpectedVisitingTimes(Environment const& env, std::vector<ExtendedValueType>& stateValues);
90
104 std::vector<ValueType> computeExpectedVisitingTimes(Environment const& env, storm::storage::BitVector const& subsystem,
105 std::vector<ValueType> const& initialValues) const;
106
107 private:
111 bool isContinuousTime() const;
112
116 void createBackwardTransitions();
117
121 void createDecomposition(Environment const& env);
122
126 void createNonBsccStateVector();
127
134 std::vector<ValueType> computeUpperBounds(storm::storage::BitVector const& stateSetAsBitVector) const;
135
142 storm::Environment getEnvironmentForSolver(storm::Environment const& env, bool topological = false) const;
143
147 storm::Environment getEnvironmentForTopologicalSolver(storm::Environment const& env) const;
148
152 void processSingletonScc(uint64_t sccState, std::vector<ExtendedValueType>& stateValues) const;
153
159 std::vector<ValueType> computeValueForStateSet(storm::Environment const& env, storm::storage::BitVector const& stateSetAsBitVector,
160 std::vector<ExtendedValueType> const& stateValues) const;
161
162 storm::storage::SparseMatrix<ValueType> const& transitionMatrix;
164
166 std::unique_ptr<storm::storage::SparseMatrix<ValueType>> computedBackwardTransitions;
167
169 std::unique_ptr<storm::storage::StronglyConnectedComponentDecomposition<ValueType>> computedSccDecomposition;
170
171 storm::storage::BitVector nonBsccStates;
172};
173
174} // namespace helper
175} // namespace modelchecker
176} // namespace storm
Helper class that optionally holds a reference to an object of type T.
Definition OptionalRef.h:48
std::vector< ExtendedValueType > computeExpectedVisitingTimes(Environment const &env, storm::storage::BitVector const &initialStates)
Computes for each state the expected number of times we are visiting that state assuming the given in...
void provideSCCDecomposition(storm::storage::StronglyConnectedComponentDecomposition< ValueType > const &decomposition)
Provides the decomposition into SCCs that can be used during the computation.
void provideBackwardTransitions(storm::storage::SparseMatrix< ValueType > const &backwardTransitions)
Provides the backward transitions that can be used during the computation.
std::function< ValueType(uint64_t)> ValueGetter
Function mapping from indices to values.
SparseDeterministicVisitingTimesHelper(storm::storage::SparseMatrix< ValueType > const &transitionMatrix)
Initializes the helper for a DTMC.
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.
This class represents the decomposition of a graph-like structure into its strongly connected compone...
std::conditional_t< storm::NumberTraits< ValueType >::HasInfinity, ValueType, ExtendedNumber< ValueType > > ExtendedValueType
The type to use for values that may be infinite.