From f9ee3d10e4a4ce026d5711c6f12f205a2c2f38c7 Mon Sep 17 00:00:00 2001 From: Sebastian Junges Date: Thu, 1 Oct 2020 00:23:22 -0700 Subject: [PATCH] simulating with rationals --- src/storm/models/ModelBase.cpp | 4 ++++ src/storm/models/ModelBase.h | 7 ++++++- src/storm/models/sparse/Pomdp.cpp | 5 +++++ src/storm/models/sparse/Pomdp.h | 2 ++ src/storm/simulator/DiscreteTimeSparseModelSimulator.cpp | 4 +++- 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/storm/models/ModelBase.cpp b/src/storm/models/ModelBase.cpp index 7bf753ab8..37ef5c80d 100644 --- a/src/storm/models/ModelBase.cpp +++ b/src/storm/models/ModelBase.cpp @@ -35,6 +35,10 @@ namespace storm { } return false; } + + bool ModelBase::isPartiallyObservable() const { + return false; + } bool ModelBase::supportsParameters() const { return false; diff --git a/src/storm/models/ModelBase.h b/src/storm/models/ModelBase.h index ca275ed92..95bfdc9e5 100644 --- a/src/storm/models/ModelBase.h +++ b/src/storm/models/ModelBase.h @@ -140,7 +140,12 @@ namespace storm { * @return True iff the model is exact. */ virtual bool isExact() const; - + + /* + * Checks whether the model is partially observable + */ + virtual bool isPartiallyObservable() const; + /*! * Converts the transition rewards of all reward models to state-based rewards. For deterministic models, * this reduces the rewards to state rewards only. For nondeterminstic models, the reward models will diff --git a/src/storm/models/sparse/Pomdp.cpp b/src/storm/models/sparse/Pomdp.cpp index 659c13e2e..a304a1898 100644 --- a/src/storm/models/sparse/Pomdp.cpp +++ b/src/storm/models/sparse/Pomdp.cpp @@ -125,6 +125,11 @@ namespace storm { this->canonicFlag = newValue; } + template + bool Pomdp::isPartiallyObservable() const { + return true; + } + template std::size_t Pomdp::hash() const { diff --git a/src/storm/models/sparse/Pomdp.h b/src/storm/models/sparse/Pomdp.h index 6b1165482..1589ac49e 100644 --- a/src/storm/models/sparse/Pomdp.h +++ b/src/storm/models/sparse/Pomdp.h @@ -90,6 +90,8 @@ namespace storm { virtual std::size_t hash() const override; + virtual bool isPartiallyObservable() const override; + protected: /*! * Return a string that is additonally added to the state information in the dot stream. diff --git a/src/storm/simulator/DiscreteTimeSparseModelSimulator.cpp b/src/storm/simulator/DiscreteTimeSparseModelSimulator.cpp index ba6ad778b..9822e8a71 100644 --- a/src/storm/simulator/DiscreteTimeSparseModelSimulator.cpp +++ b/src/storm/simulator/DiscreteTimeSparseModelSimulator.cpp @@ -18,7 +18,7 @@ namespace storm { template void DiscreteTimeSparseModelSimulator::setSeed(uint64_t seed) { - generator = storm::utility::RandomProbabilityGenerator(seed); + generator = storm::utility::RandomProbabilityGenerator(seed); } template @@ -89,5 +89,7 @@ namespace storm { } template class DiscreteTimeSparseModelSimulator; + template class DiscreteTimeSparseModelSimulator; + } }