Browse Source

Canonic POMDP in -> Canonic POMDP out

tempestpy_adaptions
Sebastian Junges 5 years ago
parent
commit
7ba3b6b8d6
  1. 4
      src/storm-pomdp/transformer/PomdpMemoryUnfolder.cpp

4
src/storm-pomdp/transformer/PomdpMemoryUnfolder.cpp

@ -19,6 +19,7 @@ namespace storm {
template<typename ValueType> template<typename ValueType>
std::shared_ptr<storm::models::sparse::Pomdp<ValueType>> PomdpMemoryUnfolder<ValueType>::transform() const { std::shared_ptr<storm::models::sparse::Pomdp<ValueType>> PomdpMemoryUnfolder<ValueType>::transform() const {
// For simplicity we first build the 'full' product of pomdp and memory (with pomdp.numStates * memory.numStates states). // For simplicity we first build the 'full' product of pomdp and memory (with pomdp.numStates * memory.numStates states).
STORM_LOG_THROW(pomdp.isCanonic() , storm::exceptions::InvalidArgumentException, "POMDP must be canonical to unfold memory into it");
storm::storage::sparse::ModelComponents<ValueType> components; storm::storage::sparse::ModelComponents<ValueType> components;
components.transitionMatrix = transformTransitions(); components.transitionMatrix = transformTransitions();
components.stateLabeling = transformStateLabeling(); components.stateLabeling = transformStateLabeling();
@ -34,7 +35,8 @@ namespace storm {
for (auto const& rewModel : pomdp.getRewardModels()) { for (auto const& rewModel : pomdp.getRewardModels()) {
components.rewardModels.emplace(rewModel.first, transformRewardModel(rewModel.second, reachableStates)); components.rewardModels.emplace(rewModel.first, transformRewardModel(rewModel.second, reachableStates));
} }
return std::make_shared<storm::models::sparse::Pomdp<ValueType>>(std::move(components));
return std::make_shared<storm::models::sparse::Pomdp<ValueType>>(std::move(components), true);
} }
template<typename ValueType> template<typename ValueType>

Loading…
Cancel
Save