From 67bcafe5e1b2282d6c065d715bd761091fcecd7d Mon Sep 17 00:00:00 2001 From: Tim Quatmann Date: Thu, 4 Jun 2020 15:32:14 +0200 Subject: [PATCH] storm-pomdp: Cleaned up includes of BeliefManager and BeliefMdpExplorer. --- src/storm-pomdp/builder/BeliefMdpExplorer.cpp | 15 ++++++++++++++- src/storm-pomdp/builder/BeliefMdpExplorer.h | 14 ++------------ src/storm-pomdp/storage/BeliefManager.cpp | 18 ++++++++++-------- src/storm-pomdp/storage/BeliefManager.h | 11 ++++------- 4 files changed, 30 insertions(+), 28 deletions(-) diff --git a/src/storm-pomdp/builder/BeliefMdpExplorer.cpp b/src/storm-pomdp/builder/BeliefMdpExplorer.cpp index d9179b295..d26db471f 100644 --- a/src/storm-pomdp/builder/BeliefMdpExplorer.cpp +++ b/src/storm-pomdp/builder/BeliefMdpExplorer.cpp @@ -1,4 +1,17 @@ -#include "BeliefMdpExplorer.h" +#include "storm-pomdp/builder/BeliefMdpExplorer.h" + +#include "storm-parsers/api/properties.h" +#include "storm/api/properties.h" + +#include "storm/modelchecker/results/CheckResult.h" +#include "storm/modelchecker/results/ExplicitQualitativeCheckResult.h" +#include "storm/modelchecker/results/ExplicitQuantitativeCheckResult.h" +#include "storm/modelchecker/hints/ExplicitModelCheckerHint.cpp" +#include "storm/models/sparse/Pomdp.h" +#include "storm/storage/SparseMatrix.h" +#include "storm/utility/constants.h" +#include "storm/utility/macros.h" +#include "storm/utility/SignalHandler.h" namespace storm { namespace builder { diff --git a/src/storm-pomdp/builder/BeliefMdpExplorer.h b/src/storm-pomdp/builder/BeliefMdpExplorer.h index 5b8b33bb5..b45812e9c 100644 --- a/src/storm-pomdp/builder/BeliefMdpExplorer.h +++ b/src/storm-pomdp/builder/BeliefMdpExplorer.h @@ -6,23 +6,13 @@ #include #include -#include "storm-parsers/api/properties.h" -#include "storm/api/properties.h" -//#include "storm/api/verification.h" #include "storm/storage/BitVector.h" -#include "storm/storage/SparseMatrix.h" -#include "storm/utility/macros.h" -#include "storm-pomdp/storage/BeliefManager.cpp" +#include "storm-pomdp/storage/BeliefManager.h" #include "storm-pomdp/modelchecker/TrivialPomdpValueBoundsModelChecker.h" -#include "storm/utility/SignalHandler.h" -#include "storm/modelchecker/results/CheckResult.h" -#include "storm/modelchecker/results/ExplicitQualitativeCheckResult.h" -#include "storm/modelchecker/results/ExplicitQuantitativeCheckResult.h" -#include "storm/modelchecker/hints/ExplicitModelCheckerHint.cpp" - namespace storm { + namespace builder { template class BeliefMdpExplorer { diff --git a/src/storm-pomdp/storage/BeliefManager.cpp b/src/storm-pomdp/storage/BeliefManager.cpp index 3b7e38f3e..82ddabaaa 100644 --- a/src/storm-pomdp/storage/BeliefManager.cpp +++ b/src/storm-pomdp/storage/BeliefManager.cpp @@ -1,4 +1,9 @@ -#include "BeliefManager.h" +#include "storm-pomdp/storage/BeliefManager.h" + +#include "storm/adapters/RationalNumberAdapter.h" +#include "storm/utility/macros.h" +#include "storm/utility/constants.h" +#include "storm/models/sparse/Pomdp.h" namespace storm { namespace storage { @@ -84,9 +89,8 @@ namespace storm { } template - template typename BeliefManager::ValueType - BeliefManager::getWeightedSum(BeliefId const &beliefId, SummandsType const &summands) { + BeliefManager::getWeightedSum(BeliefId const &beliefId, std::vector const &summands) { ValueType result = storm::utility::zero(); for (auto const &entry : getBelief(beliefId)) { result += storm::utility::convertNumber(entry.second) * storm::utility::convertNumber(summands.at(entry.first)); @@ -179,7 +183,7 @@ namespace storm { uint32_t obs = getBeliefObservation(belief); STORM_LOG_ASSERT(obs < beliefToIdMap.size(), "Belief has unknown observation."); auto idIt = beliefToIdMap[obs].find(belief); - STORM_LOG_ASSERT(idIt != beliefToIdMap.end(), "Unknown Belief."); + STORM_LOG_ASSERT(idIt != beliefToIdMap[obs].end(), "Unknown Belief."); return idIt->second; } @@ -506,10 +510,8 @@ namespace storm { return insertioRes.first->second; } - template - class BeliefManager>; + template class BeliefManager>; - template - class BeliefManager>; + template class BeliefManager>; } } \ No newline at end of file diff --git a/src/storm-pomdp/storage/BeliefManager.h b/src/storm-pomdp/storage/BeliefManager.h index 8cdf1fbc4..087114a55 100644 --- a/src/storm-pomdp/storage/BeliefManager.h +++ b/src/storm-pomdp/storage/BeliefManager.h @@ -1,13 +1,12 @@ #pragma once -#include "storm/api/storm.h" +#include #include #include #include #include -#include "storm/adapters/RationalNumberAdapter.h" -#include "storm/utility/macros.h" -#include "storm/exceptions/UnexpectedException.h" + +#include "storm/utility/ConstantsComparator.h" namespace storm { namespace storage { @@ -46,9 +45,7 @@ namespace storm { std::string toString(Triangulation const &t) const; - template - ValueType getWeightedSum(BeliefId const &beliefId, SummandsType const &summands); - + ValueType getWeightedSum(BeliefId const &beliefId, std::vector const &summands); BeliefId const &getInitialBelief() const;