diff --git a/src/settings/modules/GeneralSettings.cpp b/src/settings/modules/GeneralSettings.cpp index eeef1ff1a..893dd4717 100644 --- a/src/settings/modules/GeneralSettings.cpp +++ b/src/settings/modules/GeneralSettings.cpp @@ -287,15 +287,11 @@ namespace storm { } GeneralSettings::Engine GeneralSettings::getEngine() const { - std::string engine = this->getOption(engineOptionName).getArgumentByName("name").getValueAsString(); - if (engine == "sparse") { - return GeneralSettings::Engine::Sparse; - } else if (engine == "hybrid") { - return GeneralSettings::Engine::Hybrid; - } else if (engine == "dd") { - return GeneralSettings::Engine::Dd; - } - STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentValueException, "Unknown engine '" << engine << "'."); + return engine; + } + + void GeneralSettings::setEngine(Engine newEngine) { + this->engine = newEngine; } bool GeneralSettings::isPrismCompatibilityEnabled() const { @@ -321,7 +317,22 @@ namespace storm { return this->getOption(parametricOptionName).getHasOptionBeenSet(); } #endif - + + void GeneralSettings::finalize() { + // Finalize engine. + std::string engineStr = this->getOption(engineOptionName).getArgumentByName("name").getValueAsString(); + if (engineStr == "sparse") { + engine = GeneralSettings::Engine::Sparse; + } else if (engineStr == "hybrid") { + engine = GeneralSettings::Engine::Hybrid; + } else if (engineStr == "dd") { + engine = GeneralSettings::Engine::Dd; + } else { + STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentValueException, "Unknown engine '" << engineStr << "'."); + } + + } + bool GeneralSettings::check() const { // Ensure that the model was given either symbolically or explicitly. STORM_LOG_THROW(!isSymbolicSet() || !isExplicitSet(), storm::exceptions::InvalidSettingsException, "The model may be either given in an explicit or a symbolic format, but not both."); diff --git a/src/settings/modules/GeneralSettings.h b/src/settings/modules/GeneralSettings.h index 2f9064e1b..1c7abdc98 100644 --- a/src/settings/modules/GeneralSettings.h +++ b/src/settings/modules/GeneralSettings.h @@ -318,6 +318,11 @@ namespace storm { */ Engine getEngine() const; + /*! + * Sets the engine for further usage. + */ + void setEngine(Engine); + /*! * Retrieves whether the PRISM compatibility mode was enabled. * @@ -349,11 +354,14 @@ namespace storm { bool check() const override; + void finalize() override; // The name of the module. static const std::string moduleName; private: + Engine engine; + // Define the string names of the options as constants. static const std::string helpOptionName; static const std::string helpOptionShortName;