From 529e31a1ba21529355fc9cc8d358244c0b168dc5 Mon Sep 17 00:00:00 2001 From: TimQu Date: Thu, 12 Oct 2017 11:03:01 +0200 Subject: [PATCH] fixed multiple initial states in pomdp unfolder --- .../transformer/PomdpMemoryUnfolder.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/storm-pomdp/transformer/PomdpMemoryUnfolder.cpp b/src/storm-pomdp/transformer/PomdpMemoryUnfolder.cpp index db550dd14..83137f8a8 100644 --- a/src/storm-pomdp/transformer/PomdpMemoryUnfolder.cpp +++ b/src/storm-pomdp/transformer/PomdpMemoryUnfolder.cpp @@ -60,9 +60,17 @@ namespace storm { storm::models::sparse::StateLabeling labeling(pomdp.getNumberOfStates() * numMemoryStates); for (auto const& labelName : pomdp.getStateLabeling().getLabels()) { storm::storage::BitVector newStates(pomdp.getNumberOfStates() * numMemoryStates, false); - for (auto const& modelState : pomdp.getStateLabeling().getStates(labelName)) { - for (uint32_t memState = 0; memState < numMemoryStates; ++memState) { - newStates.set(getUnfoldingState(modelState, memState)); + + // The init label is only assigned to unfolding states with memState 0 + if (labelName == "init") { + for (auto const& modelState : pomdp.getStateLabeling().getStates(labelName)) { + newStates.set(getUnfoldingState(modelState, 0)); + } + } else { + for (auto const& modelState : pomdp.getStateLabeling().getStates(labelName)) { + for (uint32_t memState = 0; memState < numMemoryStates; ++memState) { + newStates.set(getUnfoldingState(modelState, memState)); + } } } labeling.addLabel(labelName, std::move(newStates));