From e2b08552086c4d5849e9fff156277b4b5f8ba1e0 Mon Sep 17 00:00:00 2001 From: Sebastian Junges Date: Thu, 28 May 2020 13:16:24 -0700 Subject: [PATCH] hashing POMDPs --- src/storm/models/sparse/Pomdp.cpp | 9 +++++++++ src/storm/models/sparse/Pomdp.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/storm/models/sparse/Pomdp.cpp b/src/storm/models/sparse/Pomdp.cpp index 16ff6e9a5..b38b3dd2f 100644 --- a/src/storm/models/sparse/Pomdp.cpp +++ b/src/storm/models/sparse/Pomdp.cpp @@ -104,6 +104,15 @@ namespace storm { this->canonicFlag = newValue; } + template + std::size_t Pomdp::hash() const { + + std::size_t seed = 0; + boost::hash_combine(seed,sparse::Model::hash()); + boost::hash_combine(seed,boost::hash_range(observations.begin(), observations.end())); + return seed; + } + template class Pomdp; template class Pomdp; diff --git a/src/storm/models/sparse/Pomdp.h b/src/storm/models/sparse/Pomdp.h index a77f772b6..408b2dec7 100644 --- a/src/storm/models/sparse/Pomdp.h +++ b/src/storm/models/sparse/Pomdp.h @@ -72,6 +72,8 @@ namespace storm { void setIsCanonic(bool newValue = true); + virtual std::size_t hash() const override; + protected: /*! * Return a string that is additonally added to the state information in the dot stream.