Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
BeliefSupportTracker.cpp
Go to the documentation of this file.
2
4
5namespace storm {
6namespace generator {
7template<typename ValueType>
9 : pomdp(pomdp), currentBeliefSupport(pomdp.getInitialStates()) {}
10
11template<typename ValueType>
15
16template<typename ValueType>
17void BeliefSupportTracker<ValueType>::track(uint64_t action, uint64_t observation) {
18 storm::storage::BitVector newBeliefSupport(pomdp.getNumberOfStates());
19 for (uint64_t oldState : currentBeliefSupport) {
20 uint64_t row = pomdp.getTransitionMatrix().getRowGroupIndices()[oldState] + action;
21 for (auto const& successor : pomdp.getTransitionMatrix().getRow(row)) {
22 assert(!storm::utility::isZero(successor.getValue()));
23 if (pomdp.getObservation(successor.getColumn()) == observation) {
24 newBeliefSupport.set(successor.getColumn(), true);
25 }
26 }
27 }
28 currentBeliefSupport = newBeliefSupport;
29}
30
31template<typename ValueType>
33 currentBeliefSupport = pomdp.getInitialStates();
34}
35
36template class BeliefSupportTracker<double>;
38
39} // namespace generator
40} // namespace storm
BeliefSupportTracker(storm::models::sparse::Pomdp< ValueType > const &pomdp)
Tracks the current belief support.
storm::storage::BitVector const & getCurrentBeliefSupport() const
The current belief support according to the tracker.
void track(uint64_t action, uint64_t observation)
Update current belief support state.
This class represents a partially observable Markov decision process.
Definition Pomdp.h:13
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:16
void set(uint64_t index, bool value=true)
Sets the given truth value at the given index.
bool isZero(ValueType const &a)
Definition constants.cpp:39