From 7afc47f354246fd47cfa164f4309c8ec88ab285a Mon Sep 17 00:00:00 2001 From: Alexander Bork Date: Fri, 8 Nov 2019 10:14:43 +0100 Subject: [PATCH] Fixed wrong size of stateLabeling if no probability 0 states were found --- src/storm-pomdp/transformer/KnownProbabilityTransformer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/storm-pomdp/transformer/KnownProbabilityTransformer.cpp b/src/storm-pomdp/transformer/KnownProbabilityTransformer.cpp index c5d225d02..45016e515 100644 --- a/src/storm-pomdp/transformer/KnownProbabilityTransformer.cpp +++ b/src/storm-pomdp/transformer/KnownProbabilityTransformer.cpp @@ -16,7 +16,9 @@ namespace storm { std::map stateMap; std::map observationMap; - storm::models::sparse::StateLabeling newLabeling(pomdp.getNumberOfStates() - prob0States.getNumberOfSetBits() - prob1States.getNumberOfSetBits() + 2); + uint64_t nrNewStates = prob0States.empty() ? 1 : 2; + + storm::models::sparse::StateLabeling newLabeling(pomdp.getNumberOfStates() - prob0States.getNumberOfSetBits() - prob1States.getNumberOfSetBits() + nrNewStates); std::vector newObservations;