Browse Source

fixed multiple initial states in pomdp unfolder

tempestpy_adaptions
TimQu 7 years ago
parent
commit
529e31a1ba
  1. 8
      src/storm-pomdp/transformer/PomdpMemoryUnfolder.cpp

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

@ -60,11 +60,19 @@ namespace storm {
storm::models::sparse::StateLabeling labeling(pomdp.getNumberOfStates() * numMemoryStates); storm::models::sparse::StateLabeling labeling(pomdp.getNumberOfStates() * numMemoryStates);
for (auto const& labelName : pomdp.getStateLabeling().getLabels()) { for (auto const& labelName : pomdp.getStateLabeling().getLabels()) {
storm::storage::BitVector newStates(pomdp.getNumberOfStates() * numMemoryStates, false); storm::storage::BitVector newStates(pomdp.getNumberOfStates() * numMemoryStates, false);
// 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 (auto const& modelState : pomdp.getStateLabeling().getStates(labelName)) {
for (uint32_t memState = 0; memState < numMemoryStates; ++memState) { for (uint32_t memState = 0; memState < numMemoryStates; ++memState) {
newStates.set(getUnfoldingState(modelState, memState)); newStates.set(getUnfoldingState(modelState, memState));
} }
} }
}
labeling.addLabel(labelName, std::move(newStates)); labeling.addLabel(labelName, std::move(newStates));
} }
return labeling; return labeling;

Loading…
Cancel
Save