diff --git a/src/storm-pomdp/transformer/BinaryPomdpTransformer.cpp b/src/storm-pomdp/transformer/BinaryPomdpTransformer.cpp index dd94aa013..6d85f8cad 100644 --- a/src/storm-pomdp/transformer/BinaryPomdpTransformer.cpp +++ b/src/storm-pomdp/transformer/BinaryPomdpTransformer.cpp @@ -25,7 +25,7 @@ namespace storm { components.transitionMatrix = std::move(data.simpleMatrix); components.observabilityClasses = std::move(data.simpleObservations); - return std::make_shared>(std::move(components)); + return std::make_shared>(std::move(components), true); } struct BinaryPomdpTransformerRowGroup { diff --git a/src/storm-pomdp/transformer/GlobalPOMDPSelfLoopEliminator.cpp b/src/storm-pomdp/transformer/GlobalPOMDPSelfLoopEliminator.cpp index 54ad9631c..b9e609218 100644 --- a/src/storm-pomdp/transformer/GlobalPOMDPSelfLoopEliminator.cpp +++ b/src/storm-pomdp/transformer/GlobalPOMDPSelfLoopEliminator.cpp @@ -72,8 +72,9 @@ namespace storm { // std::cout << "selection: " << filter << std::endl; ChoiceSelector cs(pomdp); - return cs.transform(filter)->template as>(); - + auto res = cs.transform(filter)->template as>(); + res->setIsCanonic(); + return res; } template class GlobalPOMDPSelfLoopEliminator; diff --git a/src/storm-pomdp/transformer/GlobalPomdpMecChoiceEliminator.cpp b/src/storm-pomdp/transformer/GlobalPomdpMecChoiceEliminator.cpp index 853b70952..4e181619c 100644 --- a/src/storm-pomdp/transformer/GlobalPomdpMecChoiceEliminator.cpp +++ b/src/storm-pomdp/transformer/GlobalPomdpMecChoiceEliminator.cpp @@ -84,7 +84,9 @@ namespace storm { } ChoiceSelector cs(pomdp); - return cs.transform(choiceFilter)->template as>(); + auto res = cs.transform(choiceFilter)->template as>(); + res->setIsCanonic(); + return res; } template @@ -122,7 +124,9 @@ namespace storm { } ChoiceSelector cs(pomdp); - return cs.transform(choiceFilter)->template as>(); + auto res = cs.transform(choiceFilter)->template as>(); + res->setIsCanonic(); + return res; } template diff --git a/src/storm-pomdp/transformer/GlobalPomdpMecChoiceEliminator.h b/src/storm-pomdp/transformer/GlobalPomdpMecChoiceEliminator.h index 668ee7cf0..cb558afff 100644 --- a/src/storm-pomdp/transformer/GlobalPomdpMecChoiceEliminator.h +++ b/src/storm-pomdp/transformer/GlobalPomdpMecChoiceEliminator.h @@ -13,6 +13,7 @@ namespace storm { class GlobalPomdpMecChoiceEliminator { public: + /* Notice that this eliminator is only correct for memoryless, strictly randomising policies */ GlobalPomdpMecChoiceEliminator(storm::models::sparse::Pomdp const& pomdp); // Note: this only preserves probabilities for memoryless pomdps diff --git a/src/storm-pomdp/transformer/KnownProbabilityTransformer.cpp b/src/storm-pomdp/transformer/KnownProbabilityTransformer.cpp index e764b69ce..7b4f59cf6 100644 --- a/src/storm-pomdp/transformer/KnownProbabilityTransformer.cpp +++ b/src/storm-pomdp/transformer/KnownProbabilityTransformer.cpp @@ -109,10 +109,9 @@ namespace storm { storm::storage::sparse::ModelComponents components(newTransitionMatrix, newLabeling); components.observabilityClasses = newObservations; - auto newPomdp = storm::models::sparse::Pomdp(components); + auto newPomdp = storm::models::sparse::Pomdp(components, true); newPomdp.printModelInformationToStream(std::cout); - return std::make_shared>(newPomdp); } diff --git a/src/storm/models/sparse/Pomdp.cpp b/src/storm/models/sparse/Pomdp.cpp index 135b74f48..16ff6e9a5 100644 --- a/src/storm/models/sparse/Pomdp.cpp +++ b/src/storm/models/sparse/Pomdp.cpp @@ -99,6 +99,10 @@ namespace storm { return canonicFlag; } + template + void Pomdp::setIsCanonic(bool newValue) { + this->canonicFlag = newValue; + } template class Pomdp; diff --git a/src/storm/models/sparse/Pomdp.h b/src/storm/models/sparse/Pomdp.h index acb542bd0..a77f772b6 100644 --- a/src/storm/models/sparse/Pomdp.h +++ b/src/storm/models/sparse/Pomdp.h @@ -70,6 +70,8 @@ namespace storm { bool isCanonic() const; + void setIsCanonic(bool newValue = true); + protected: /*! * Return a string that is additonally added to the state information in the dot stream.