From 81ecf752c813e806bdc5b7308677c91735a71257 Mon Sep 17 00:00:00 2001 From: dehnert Date: Wed, 19 Apr 2017 10:54:04 +0200 Subject: [PATCH] better diagnostic for unsupported model type in JIT builder --- src/storm/builder/jit/ModelComponentsBuilder.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/storm/builder/jit/ModelComponentsBuilder.cpp b/src/storm/builder/jit/ModelComponentsBuilder.cpp index 62c78bc72..6c51840ad 100644 --- a/src/storm/builder/jit/ModelComponentsBuilder.cpp +++ b/src/storm/builder/jit/ModelComponentsBuilder.cpp @@ -131,7 +131,7 @@ namespace storm { return new storm::models::sparse::Ctmc>(std::move(transitionMatrix), std::move(stateLabeling), std::move(rewardModels)); } else if (modelType == storm::jani::ModelType::MDP) { return new storm::models::sparse::Mdp>(std::move(transitionMatrix), std::move(stateLabeling), std::move(rewardModels)); - } else { + } else if (modelType == storm::jani::ModelType::MA) { std::vector exitRates(transitionMatrix.getRowGroupCount(), storm::utility::zero()); for (auto state : *markovianStates) { for (auto const& element : transitionMatrix.getRow(transitionMatrix.getRowGroupIndices()[state])) { @@ -143,6 +143,8 @@ namespace storm { } return new storm::models::sparse::MarkovAutomaton>(std::move(transitionMatrix), std::move(stateLabeling), std::move(*markovianStates), std::move(exitRates), std::move(rewardModels)); + } else { + STORM_LOG_THROW(false, storm::exceptions::WrongFormatException, "Model type unsupported by JIT builder."); } }