From e2ba3dbd0611d60a6838679f7dff9dda9b66f59b Mon Sep 17 00:00:00 2001 From: TimQu Date: Mon, 28 Aug 2017 10:28:32 +0200 Subject: [PATCH] fix for multiple subobjectives --- .../rewardbounded/MultiDimensionalRewardUnfolding.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/storm/modelchecker/multiobjective/rewardbounded/MultiDimensionalRewardUnfolding.cpp b/src/storm/modelchecker/multiobjective/rewardbounded/MultiDimensionalRewardUnfolding.cpp index 18b4cac96..eedb137c6 100644 --- a/src/storm/modelchecker/multiobjective/rewardbounded/MultiDimensionalRewardUnfolding.cpp +++ b/src/storm/modelchecker/multiobjective/rewardbounded/MultiDimensionalRewardUnfolding.cpp @@ -242,9 +242,14 @@ namespace storm { uint64_t productChoice = ecElimResult.newToOldRowMapping[reducedChoice]; SolutionType choiceSolution = getZeroSolution(); Epoch successorEpoch = getSuccessorEpoch(epoch, productEpochSteps[productChoice].get()); - storm::storage::BitVector greaterZeroDimensions = storm::utility::vector::filter(successorEpoch, [] (int64_t const& e) -> bool { return e >= 0; }); + storm::storage::BitVector relevantDimensions(successorEpoch.size(), true); + for (uint64_t dim = 0; dim < successorEpoch.size(); ++dim) { + if (successorEpoch[dim] < 0) { + relevantDimensions &= ~objectiveDimensions[subObjectives[dim].second]; + } + } for (auto const& successor : modelMemoryProduct->getTransitionMatrix().getRow(productChoice)) { - storm::storage::BitVector successorMemoryState = convertMemoryState(getMemoryState(successor.getColumn())) & greaterZeroDimensions; + storm::storage::BitVector successorMemoryState = convertMemoryState(getMemoryState(successor.getColumn())) & relevantDimensions; uint64_t successorProductState = getProductState(getModelState(successor.getColumn()), convertMemoryState(successorMemoryState)); SolutionType const& successorSolution = getStateSolution(successorEpoch, successorProductState); addScaledSolution(choiceSolution, successorSolution, successor.getValue()); @@ -272,7 +277,6 @@ namespace storm { void MultiDimensionalRewardUnfolding::setCurrentEpochClass(Epoch const& epoch) { auto productObjectiveRewards = computeObjectiveRewardsForProduct(epoch); - storm::storage::BitVector stepChoices(modelMemoryProduct->getNumberOfChoices(), false); uint64_t choice = 0; for (auto const& step : productEpochSteps) {