From 62e3a626860dc52397a166fa79a387122fef4a3f Mon Sep 17 00:00:00 2001 From: Alexander Bork Date: Wed, 18 Mar 2020 17:41:12 +0100 Subject: [PATCH] Fix for belief reward computation --- .../modelchecker/ApproximatePOMDPModelchecker.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/storm-pomdp/modelchecker/ApproximatePOMDPModelchecker.cpp b/src/storm-pomdp/modelchecker/ApproximatePOMDPModelchecker.cpp index 91971def3..594d213b8 100644 --- a/src/storm-pomdp/modelchecker/ApproximatePOMDPModelchecker.cpp +++ b/src/storm-pomdp/modelchecker/ApproximatePOMDPModelchecker.cpp @@ -1279,9 +1279,8 @@ namespace storm { template ValueType ApproximatePOMDPModelchecker::getRewardAfterAction(uint64_t action, storm::pomdp::Belief &belief) { auto result = storm::utility::zero(); - for (size_t i = 0; i < belief.probabilities.size(); ++i) { - for (auto const &probEntry : belief.probabilities) - result += probEntry.second * pomdp.getUniqueRewardModel().getTotalStateActionReward(probEntry.first, action, pomdp.getTransitionMatrix()); + for (auto const &probEntry : belief.probabilities) { + result += probEntry.second * pomdp.getUniqueRewardModel().getTotalStateActionReward(probEntry.first, action, pomdp.getTransitionMatrix()); } return result; }