Browse Source

storm-pomdp: Cleaned up includes of BeliefManager and BeliefMdpExplorer.

tempestpy_adaptions
Tim Quatmann 5 years ago
parent
commit
67bcafe5e1
  1. 15
      src/storm-pomdp/builder/BeliefMdpExplorer.cpp
  2. 14
      src/storm-pomdp/builder/BeliefMdpExplorer.h
  3. 18
      src/storm-pomdp/storage/BeliefManager.cpp
  4. 11
      src/storm-pomdp/storage/BeliefManager.h

15
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 {

14
src/storm-pomdp/builder/BeliefMdpExplorer.h

@ -6,23 +6,13 @@
#include <map>
#include <boost/optional.hpp>
#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<typename PomdpType, typename BeliefValueType = typename PomdpType::ValueType>
class BeliefMdpExplorer {

18
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<typename PomdpType, typename BeliefValueType, typename StateType>
template<typename SummandsType>
typename BeliefManager<PomdpType, BeliefValueType, StateType>::ValueType
BeliefManager<PomdpType, BeliefValueType, StateType>::getWeightedSum(BeliefId const &beliefId, SummandsType const &summands) {
BeliefManager<PomdpType, BeliefValueType, StateType>::getWeightedSum(BeliefId const &beliefId, std::vector<ValueType> const &summands) {
ValueType result = storm::utility::zero<ValueType>();
for (auto const &entry : getBelief(beliefId)) {
result += storm::utility::convertNumber<ValueType>(entry.second) * storm::utility::convertNumber<ValueType>(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<storm::models::sparse::Pomdp<double>>;
template class BeliefManager<storm::models::sparse::Pomdp<double>>;
template
class BeliefManager<storm::models::sparse::Pomdp<storm::RationalNumber>>;
template class BeliefManager<storm::models::sparse::Pomdp<storm::RationalNumber>>;
}
}

11
src/storm-pomdp/storage/BeliefManager.h

@ -1,13 +1,12 @@
#pragma once
#include "storm/api/storm.h"
#include <vector>
#include <unordered_map>
#include <boost/optional.hpp>
#include <boost/container/flat_map.hpp>
#include <boost/container/flat_set.hpp>
#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<typename SummandsType>
ValueType getWeightedSum(BeliefId const &beliefId, SummandsType const &summands);
ValueType getWeightedSum(BeliefId const &beliefId, std::vector<ValueType> const &summands);
BeliefId const &getInitialBelief() const;

Loading…
Cancel
Save