Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
BeliefSupportTracker.cpp
Go to the documentation of this file.
3
4namespace storm {
5namespace generator {
6template<typename ValueType>
8 : pomdp(pomdp), currentBeliefSupport(pomdp.getInitialStates()) {}
9
10template<typename ValueType>
14
15template<typename ValueType>
16void BeliefSupportTracker<ValueType>::track(uint64_t action, uint64_t observation) {
17 storm::storage::BitVector newBeliefSupport(pomdp.getNumberOfStates());
18 for (uint64_t oldState : currentBeliefSupport) {
19 uint64_t row = pomdp.getTransitionMatrix().getRowGroupIndices()[oldState] + action;
20 for (auto const& successor : pomdp.getTransitionMatrix().getRow(row)) {
21 assert(!storm::utility::isZero(successor.getValue()));
22 if (pomdp.getObservation(successor.getColumn()) == observation) {
23 newBeliefSupport.set(successor.getColumn(), true);
24 }
25 }
26 }
27 currentBeliefSupport = newBeliefSupport;
28}
29
30template<typename ValueType>
32 currentBeliefSupport = pomdp.getInitialStates();
33}
34
35template class BeliefSupportTracker<double>;
37
38} // namespace generator
39} // 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:15
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:18
void set(uint_fast64_t index, bool value=true)
Sets the given truth value at the given index.
bool isZero(ValueType const &a)
Definition constants.cpp:41
LabParser.cpp.
Definition cli.cpp:18