Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
UniqueObservationStates.cpp
Go to the documentation of this file.
2
3namespace storm {
4namespace analysis {
5
6template<typename ValueType>
8
9template<typename ValueType>
11 storm::storage::BitVector seenOnce(pomdp.getNrObservations(), false);
12 storm::storage::BitVector seenMoreThanOnce(pomdp.getNrObservations(), false);
13
14 for (auto const& observation : pomdp.getObservations()) {
15 if (seenOnce.get(observation)) {
16 seenMoreThanOnce.set(observation);
17 }
18 seenOnce.set(observation);
19 }
20
21 storm::storage::BitVector uniqueObservation(pomdp.getNumberOfStates(), false);
22 for (uint64_t state = 0; state < pomdp.getNumberOfStates(); ++state) {
23 if (!seenMoreThanOnce.get(pomdp.getObservation(state))) {
24 uniqueObservation.set(state);
25 }
26 }
27 return uniqueObservation;
28}
29
31
33} // namespace analysis
34} // namespace storm
UniqueObservationStates(storm::models::sparse::Pomdp< ValueType > const &pomdp)
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 get(uint_fast64_t index) const
Retrieves the truth value of the bit at the given index and performs a bound check.
LabParser.cpp.
Definition cli.cpp:18