Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
PrioritizedStateEliminator.cpp
Go to the documentation of this file.
2
7
8namespace storm {
9namespace solver {
10namespace stateelimination {
11
12template<typename ValueType>
15 std::vector<storm::storage::sparse::state_type> const& statesToEliminate,
16 std::vector<ValueType>& stateValues)
17 : PrioritizedStateEliminator(transitionMatrix, backwardTransitions, std::make_shared<StaticStatePriorityQueue>(statesToEliminate), stateValues) {}
18
19template<typename ValueType>
22 PriorityQueuePointer priorityQueue, std::vector<ValueType>& stateValues)
23 : StateEliminator<ValueType>(transitionMatrix, backwardTransitions), priorityQueue(priorityQueue), stateValues(stateValues) {}
24
25template<typename ValueType>
27 stateValues[state] = storm::utility::simplify((ValueType)(loopProbability * stateValues[state]));
28}
29
30template<typename ValueType>
33 stateValues[predecessor] =
34 storm::utility::simplify((ValueType)(stateValues[predecessor] + storm::utility::simplify((ValueType)(probability * stateValues[state]))));
35}
36
37template<typename ValueType>
39 priorityQueue->update(state);
40}
41
42template<typename ValueType>
43void PrioritizedStateEliminator<ValueType>::eliminateAll(bool removeForwardTransitions) {
44 while (priorityQueue->hasNext()) {
45 storm::storage::sparse::state_type state = priorityQueue->pop();
46 this->eliminateState(state, removeForwardTransitions);
47 if (removeForwardTransitions) {
48 clearStateValues(state);
49 }
50 }
51}
52
53template<typename ValueType>
55 stateValues[state] = storm::utility::zero<ValueType>();
56}
57
59
62} // namespace stateelimination
63} // namespace solver
64} // namespace storm
virtual void updatePriority(storm::storage::sparse::state_type const &state) override
PrioritizedStateEliminator(storm::storage::FlexibleSparseMatrix< ValueType > &transitionMatrix, storm::storage::FlexibleSparseMatrix< ValueType > &backwardTransitions, PriorityQueuePointer priorityQueue, std::vector< ValueType > &stateValues)
virtual void clearStateValues(storm::storage::sparse::state_type const &state)
virtual void eliminateAll(bool eliminateForwardTransitions=true)
virtual void updateValue(storm::storage::sparse::state_type const &state, ValueType const &loopProbability) override
virtual void updatePredecessor(storm::storage::sparse::state_type const &predecessor, ValueType const &probability, storm::storage::sparse::state_type const &state) override
The flexible sparse matrix is used during state elimination.
ValueType simplify(ValueType value)