From bd3e062988071a6dc3824da3e4b1407d032451df Mon Sep 17 00:00:00 2001 From: Matthias Volk Date: Fri, 22 Mar 2019 18:58:34 +0100 Subject: [PATCH] Added default case for switch --- src/storm-dft/builder/ExplicitDFTModelBuilder.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/storm-dft/builder/ExplicitDFTModelBuilder.cpp b/src/storm-dft/builder/ExplicitDFTModelBuilder.cpp index 298936440..2ecabe6e4 100644 --- a/src/storm-dft/builder/ExplicitDFTModelBuilder.cpp +++ b/src/storm-dft/builder/ExplicitDFTModelBuilder.cpp @@ -1,6 +1,7 @@ #include "ExplicitDFTModelBuilder.h" #include +#include #include "storm/models/sparse/MarkovAutomaton.h" #include "storm/models/sparse/Ctmc.h" @@ -169,6 +170,8 @@ namespace storm { case storm::builder::ApproximationHeuristic::BOUNDDIFFERENCE: heuristic = std::make_shared>(initialStateIndex); break; + default: + STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentException, "Heuristic not known."); } heuristic->markExpand(); statesNotExplored[initialStateIndex].second = heuristic; @@ -184,9 +187,10 @@ namespace storm { break; case storm::builder::ApproximationHeuristic::PROBABILITY: case storm::builder::ApproximationHeuristic::BOUNDDIFFERENCE: - double exponent = iteration; // Need conversion to avoid overflow when negating - approximationThreshold = std::pow(2, -exponent); + approximationThreshold = std::pow(2, -(double)iteration); // Need conversion to avoid overflow when negating break; + default: + STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentException, "Heuristic not known."); } } exploreStateSpace(approximationThreshold); @@ -399,6 +403,8 @@ namespace storm { case storm::builder::ApproximationHeuristic::BOUNDDIFFERENCE: heuristic = std::make_shared>(stateProbabilityPair.first, *currentExplorationHeuristic, stateProbabilityPair.second, choice.getTotalMass()); break; + default: + STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentException, "Heuristic not known."); } iter->second.second = heuristic;