10template<
typename ValueType>
16 ValueType
getRisk(uint64_t)
const;
21 uint64_t
getState(uint32_t obs, uint64_t offset)
const;
27 std::vector<ValueType> riskPerState;
28 std::vector<uint64_t> numberActionsPerObservation;
29 uint64_t beliefIdCounter = 0;
30 std::vector<uint64_t> observationOffsetId;
31 std::vector<std::vector<uint64_t>> statePerObservationAndOffset;
34template<
typename ValueType>
36template<
typename ValueType>
42template<
typename ValueType>
51 void update(uint32_t newObservation, std::unordered_set<SparseBeliefState>& previousBeliefs)
const;
52 std::size_t
hash()
const noexcept;
58 ValueType
get(uint64_t state)
const;
70 std::map<uint64_t, ValueType>
const&
getBeliefMap()
const;
75 void updateHelper(std::vector<std::map<uint64_t, ValueType>>
const& partialBeliefs, std::vector<ValueType>
const& sums,
76 typename std::map<uint64_t, ValueType>::const_iterator nextStateIt, uint32_t newObservation,
79 ValueType
const& risk, uint64_t prevId);
80 std::shared_ptr<BeliefStateManager<ValueType>> manager;
82 std::map<uint64_t, ValueType> belief;
83 std::size_t prestoredhash = 0;
92template<
typename ValueType>
94template<
typename ValueType>
97template<
typename ValueType>
101 void update(uint32_t newObservation, std::unordered_set<ObservationDenseBeliefState>& previousBeliefs)
const;
102 std::size_t
hash()
const noexcept;
103 ValueType
get(uint64_t state)
const;
111 void updateHelper(std::vector<std::map<uint64_t, ValueType>>
const& partialBeliefs, std::vector<ValueType>
const& sums, uint64_t currentEntry,
114 std::size_t newHash, ValueType
const& risk, uint64_t prevId);
115 std::shared_ptr<BeliefStateManager<ValueType>> manager;
117 std::vector<ValueType> belief;
118 uint64_t observation = 0;
119 std::size_t prestoredhash = 0;
132template<
typename ValueType,
typename BeliefState>
147 bool reset(uint32_t observation);
153 bool track(uint64_t newObservation);
179 void setRisk(std::vector<ValueType>
const& risk);
199 std::shared_ptr<BeliefStateManager<ValueType>> manager;
200 std::unordered_set<BeliefState> beliefs;
201 bool reductionTimedOut =
false;
203 uint32_t lastObservation;
211struct hash<
storm::generator::SparseBeliefState<T>> {
217struct hash<
storm::generator::ObservationDenseBeliefState<T>> {
This class keeps track of common information of a set of beliefs.
uint64_t getObservationOffset(uint64_t state) const
uint64_t getNumberOfStates() const
ValueType getRisk(uint64_t) const
storm::models::sparse::Pomdp< ValueType > const & getPomdp() const
uint64_t getState(uint32_t obs, uint64_t offset) const
uint64_t numberOfStatesPerObservation(uint32_t observation) const
uint32_t getObservation(uint64_t state) const
void setRiskPerState(std::vector< ValueType > const &risk)
uint64_t getActionsForObservation(uint32_t observation) const
This tracker implements state estimation for POMDPs.
std::unordered_set< BeliefState > const & getCurrentBeliefs() const
Provides access to the current beliefs.
uint64_t reduce()
Apply reductions to the belief state.
ValueType getCurrentRisk(bool max=true)
What is the (worst-case/best-case) risk over all beliefs.
void setRisk(std::vector< ValueType > const &risk)
Sets the state-risk to use for all beliefs.
uint64_t getCurrentDimension() const
What is the dimension of the current set of beliefs, i.e., what is the number of states we could poss...
uint32_t getCurrentObservation() const
What was the last obervation that we made?
bool hasTimedOut() const
Did we time out during the computation?
bool reset(uint32_t observation)
Start with a new trace.
uint64_t getNumberOfBeliefs() const
How many beliefs are we currently tracking?
bool track(uint64_t newObservation)
Extend the observed trace with the new observation.
ObservationDenseBeliefState stores beliefs in a dense format (per observation).
ValueType getRisk() const
ValueType get(uint64_t state) const
void setSupport(storm::storage::BitVector &) const
std::string toString() const
uint64_t getSupportSize() const
std::size_t hash() const noexcept
void update(uint32_t newObservation, std::unordered_set< ObservationDenseBeliefState > &previousBeliefs) const
SparseBeliefState stores beliefs in a sparse format.
void setSupport(storm::storage::BitVector &) const
void update(uint32_t newObservation, std::unordered_set< SparseBeliefState > &previousBeliefs) const
Update the belief using the new observation.
std::string toString() const
std::map< uint64_t, ValueType > const & getBeliefMap() const
ValueType get(uint64_t state) const
Get the estimate to be in the given state.
std::size_t hash() const noexcept
uint64_t getSupportSize() const
ValueType getRisk() const
Get the weighted risk.
This class represents a partially observable Markov decision process.
A bit vector that is internally represented as a vector of 64-bit values.
bool operator==(SparseBeliefState< ValueType > const &lhs, SparseBeliefState< ValueType > const &rhs)
std::size_t operator()(storm::generator::ObservationDenseBeliefState< T > const &s) const noexcept
std::size_t operator()(storm::generator::SparseBeliefState< T > const &s) const noexcept