From 13ade58fa0b0642db3b99be0666e34e227ac263c Mon Sep 17 00:00:00 2001 From: TimQu Date: Fri, 8 Sep 2017 09:29:59 +0200 Subject: [PATCH] using pair in the map instead of vectors of size 2 --- .../rewardbounded/MultiDimensionalRewardUnfolding.cpp | 6 ++---- .../rewardbounded/MultiDimensionalRewardUnfolding.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/storm/modelchecker/multiobjective/rewardbounded/MultiDimensionalRewardUnfolding.cpp b/src/storm/modelchecker/multiobjective/rewardbounded/MultiDimensionalRewardUnfolding.cpp index 3639eaf71..e08866a3f 100644 --- a/src/storm/modelchecker/multiobjective/rewardbounded/MultiDimensionalRewardUnfolding.cpp +++ b/src/storm/modelchecker/multiobjective/rewardbounded/MultiDimensionalRewardUnfolding.cpp @@ -501,16 +501,14 @@ namespace storm { void MultiDimensionalRewardUnfolding::setSolutionForCurrentEpoch(uint64_t const& productState, SolutionType const& solution) { STORM_LOG_ASSERT(currentEpoch, "Tried to set a solution for the current epoch, but no epoch was specified before."); //std::cout << "Storing solution for epoch " << epochToString(currentEpoch.get()) << " and state " << productState << std::endl; - std::vector solutionKey = { currentEpoch.get() , productState}; - solutions[solutionKey] = solution; + solutions[std::make_pair(currentEpoch.get(), productState)] = solution; } template typename MultiDimensionalRewardUnfolding::SolutionType const& MultiDimensionalRewardUnfolding::getStateSolution(Epoch const& epoch, uint64_t const& productState) { swFindSol.start(); //std::cout << "Getting solution for epoch " << epochToString(epoch) << " and state " << productState << std::endl; - std::vector solutionKey = { epoch , productState}; - auto solutionIt = solutions.find(solutionKey); + auto solutionIt = solutions.find(std::make_pair(epoch, productState)); STORM_LOG_ASSERT(solutionIt != solutions.end(), "Requested unexisting solution for epoch " << epochToString(epoch) << "."); swFindSol.stop(); return solutionIt->second; diff --git a/src/storm/modelchecker/multiobjective/rewardbounded/MultiDimensionalRewardUnfolding.h b/src/storm/modelchecker/multiobjective/rewardbounded/MultiDimensionalRewardUnfolding.h index b653d3556..31e519608 100644 --- a/src/storm/modelchecker/multiobjective/rewardbounded/MultiDimensionalRewardUnfolding.h +++ b/src/storm/modelchecker/multiobjective/rewardbounded/MultiDimensionalRewardUnfolding.h @@ -182,7 +182,7 @@ namespace storm { std::vector scalingFactors; - std::map, SolutionType> solutions; + std::map, SolutionType> solutions; storm::utility::Stopwatch swInit, swFindSol, swInsertSol, swSetEpoch, swSetEpochClass, swAux1, swAux2, swAux3, swAux4;