Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
PrioritizedStateEliminator.cpp
Go to the documentation of this file.
2
7
9
10namespace storm {
11namespace solver {
12namespace stateelimination {
13
14template<typename ValueType>
17 std::vector<storm::storage::sparse::state_type> const& statesToEliminate,
18 std::vector<ValueType>& stateValues)
19 : PrioritizedStateEliminator(transitionMatrix, backwardTransitions, std::make_shared<StaticStatePriorityQueue>(statesToEliminate), stateValues) {}
20
21template<typename ValueType>
24 PriorityQueuePointer priorityQueue, std::vector<ValueType>& stateValues)
25 : StateEliminator<ValueType>(transitionMatrix, backwardTransitions), priorityQueue(priorityQueue), stateValues(stateValues) {}
26
27template<typename ValueType>
29 stateValues[state] = storm::utility::simplify((ValueType)(loopProbability * stateValues[state]));
30}
31
32template<typename ValueType>
35 stateValues[predecessor] =
36 storm::utility::simplify((ValueType)(stateValues[predecessor] + storm::utility::simplify((ValueType)(probability * stateValues[state]))));
37}
38
39template<typename ValueType>
41 priorityQueue->update(state);
42}
43
44template<typename ValueType>
45void PrioritizedStateEliminator<ValueType>::eliminateAll(bool removeForwardTransitions) {
46 while (priorityQueue->hasNext()) {
47 storm::storage::sparse::state_type state = priorityQueue->pop();
48 this->eliminateState(state, removeForwardTransitions);
49 if (removeForwardTransitions) {
50 clearStateValues(state);
51 }
52 }
53}
54
55template<typename ValueType>
57 stateValues[state] = storm::utility::zero<ValueType>();
58}
59
61
62#ifdef STORM_HAVE_CARL
65#endif
66} // namespace stateelimination
67} // namespace solver
68} // 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)
LabParser.cpp.
Definition cli.cpp:18