15template<
typename ValueType>
20template<
typename ValueType>
21template<
typename RewardModelType>
27template<
typename ValueType>
30 std::vector<ValueType>
const& vector) {
31 performRobustMaximalEndComponentDecomposition(transitionMatrix, backwardTransitions, vector);
34template<
typename ValueType>
37 std::vector<ValueType>
const& vector,
39 performRobustMaximalEndComponentDecomposition(transitionMatrix, backwardTransitions, vector, states);
42template<
typename ValueType>
48template<
typename ValueType>
55template<
typename ValueType>
61template<
typename ValueType>
68template<
typename ValueType>
91 for (
auto state : remainingEcCandidates) {
93 nonTrivSccIndices.set(sccIndex,
true);
97 double probabilityToStayInScc = 0;
99 if (vector && vector->at(state).lower() == 0) {
101 for (
auto const& entry : transitionMatrix.getRow(state)) {
102 const bool targetInSCC = sccIndex == sccDecRes.
stateToSccMapping[entry.getColumn()];
103 auto const& interval = entry.getValue();
106 probabilityToStayInScc = 0;
108 }
else if (targetInSCC) {
109 probabilityToStayInScc += interval.upper();
115 if (probabilityToStayInScc < 1) {
117 remainingEcCandidates.
set(state,
false);
119 ecSccIndices.set(sccIndex,
false);
124 ecSccIndices &= nonTrivSccIndices;
126 for (
auto sccIndex : ecSccIndices) {
127 StronglyConnectedComponent newMec;
128 for (
auto state : remainingEcCandidates) {
134 remainingEcCandidates.
set(state,
false);
136 newMec.insert(state);
138 this->blocks.emplace_back(std::move(newMec));
142 for (
auto sccIndex : nonTrivSccIndices) {
143 for (uint64_t state = 0; state < transitionMatrix.
getRowCount(); state++) {
146 double stayInsideECProb = 0;
147 for (
auto& entry : updatingMatrix.getRow(state)) {
148 const bool targetInEC = sccIndex == sccDecRes.
stateToSccMapping[entry.getColumn()];
153 auto const& interval = entry.getValue();
156 if (interval.upper() > 0 && stayInsideECProb < 1) {
157 stayInsideECProb += interval.upper();
165 if (nonTrivSccIndices == ecSccIndices) {
170 sccDecOptions.
subsystem(remainingEcCandidates);
173 STORM_LOG_DEBUG(
"MEC decomposition found " << this->size() <<
" MEC(s).");
176template<
typename ValueType>
178 std::vector<uint64_t> result(numberOfStates, std::numeric_limits<uint64_t>::max());
179 uint64_t sccIndex = 0;
180 for (
auto const& scc : *
this) {
181 for (
auto const& state : scc) {
182 result[state] = sccIndex;
Helper class that optionally holds a reference to an object of type T.
The base class of all sparse deterministic models.
storm::storage::SparseMatrix< ValueType > const & getTransitionMatrix() const
Retrieves the matrix representing the transitions of the model.
storm::storage::SparseMatrix< ValueType > getBackwardTransitions() const
Retrieves the backward transition relation of the model, i.e.
A bit vector that is internally represented as a vector of 64-bit values.
void set(uint64_t index, bool value=true)
Sets the given truth value at the given index.
This class represents the decomposition of a model into blocks which are of the template type.
Decomposition & operator=(Decomposition const &other)
Assigns the contents of the given decomposition to the current one by copying the contents.
This class represents the decomposition of a nondeterministic model into its maximal end components.
RobustMaximalEndComponentDecomposition()
RobustMaximalEndComponentDecomposition & operator=(RobustMaximalEndComponentDecomposition const &other)
Assigns the contents of the given MEC decomposition to the current one by copying its contents.
std::vector< uint64_t > computeStateToSccIndexMap(uint64_t numberOfStates) const
Computes a vector that for each state has the index of the scc of that state in it.
A class that holds a possibly non-square matrix in the compressed row storage format.
index_type getRowCount() const
Returns the number of rows of the matrix.
#define STORM_LOG_DEBUG(message)
void performSccDecomposition(storm::storage::SparseMatrix< ValueType > const &transitionMatrix, StronglyConnectedComponentDecompositionOptions const &options, SccDecompositionResult &result)
Computes an SCC decomposition for the given matrix and options.
bool isZero(ValueType const &a)
Holds temporary computation data used during the SCC decomposition algorithm.
Holds the result data of the implemented SCC decomposition algorithm.
std::vector< uint64_t > stateToSccMapping
Number of found SCCs.
storm::storage::BitVector nonTrivialStates
Mapping from states to the SCC it belongs to.
uint64_t sccCount
True if an SCC is associated to the given state.
StronglyConnectedComponentDecompositionOptions & dropNaiveSccs(bool value=true)
Sets if trivial SCCs (i.e. SCCs consisting of just one state without a self-loop) are to be kept in t...
StronglyConnectedComponentDecompositionOptions & subsystem(storm::storage::BitVector const &subsystem)
Sets a bit vector indicating which subsystem to consider for the decomposition into SCCs.