9#include <boost/functional/hash.hpp>
13template<
typename ValueType>
18template<
typename ValueType>
23template<
typename ValueType>
26 return data.begin()->first;
29template<
typename ValueType>
34template<
typename ValueType>
36 if (obs != other.obs) {
39 if (data.size() != other.
size()) {
43 auto secondIt = other.data.cbegin();
44 for (
auto const& [state, value] : data) {
45 if (state != secondIt->first) {
56template<
typename ValueType>
59 ss <<
"Belief{ obs:" << obs;
60 if (convertToDouble) {
61 forEach([&ss, fullPrecision](
auto const& state,
auto const& val) {
62 ss <<
", " << state <<
":";
64 ss << storm::utility::to_string(storm::utility::convertNumber<double>(val));
66 ss << storm::utility::convertNumber<double>(val);
70 forEach([&ss, fullPrecision](
auto const& state,
auto const& val) {
71 ss <<
", " << state <<
":";
83template<
typename ValueType>
85 auto seed =
static_cast<std::size_t
>(belief.obs);
87 belief.
forEach([&seed](
auto const& state,
auto const& val) {
88 boost::hash_combine(seed, state);
std::string toString(bool convertToDouble=true, bool fullPrecision=false) const
A (human-readable) string representation of this belief.
BeliefStateType representativeState() const
void forEach(FunctionType const &f) const
BeliefObservationType const & observation() const
bool operator==(Belief const &other) const
#define STORM_LOG_ASSERT(cond, message)
uint64_t BeliefStateType
Shared identifiers and sparse-container types used by the belief subsystem.
uint32_t BeliefObservationType
constexpr bool BeliefFlatMapIsOrdered
boost::container::flat_map< BeliefStateType, BeliefValueType > BeliefFlatMap
std::string to_string(ValueType const &value)
std::size_t operator()(Belief const &belief) const
static ValueType valueForHash(ValueType const &val)
static bool equal(ValueType const &lhs, ValueType const &rhs)