Browse Source

change engine in options...(preliminary)

Former-commit-id: 56e05ef08c
main
sjunges 10 years ago
parent
commit
3a17477713
  1. 31
      src/settings/modules/GeneralSettings.cpp
  2. 8
      src/settings/modules/GeneralSettings.h

31
src/settings/modules/GeneralSettings.cpp

@ -287,15 +287,11 @@ namespace storm {
} }
GeneralSettings::Engine GeneralSettings::getEngine() const { GeneralSettings::Engine GeneralSettings::getEngine() const {
std::string engine = this->getOption(engineOptionName).getArgumentByName("name").getValueAsString(); return engine;
if (engine == "sparse") { }
return GeneralSettings::Engine::Sparse; void GeneralSettings::setEngine(Engine newEngine) {
} else if (engine == "hybrid") { this->engine = newEngine;
return GeneralSettings::Engine::Hybrid;
} else if (engine == "dd") {
return GeneralSettings::Engine::Dd;
}
STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentValueException, "Unknown engine '" << engine << "'.");
} }
bool GeneralSettings::isPrismCompatibilityEnabled() const { bool GeneralSettings::isPrismCompatibilityEnabled() const {
@ -321,7 +317,22 @@ namespace storm {
return this->getOption(parametricOptionName).getHasOptionBeenSet(); return this->getOption(parametricOptionName).getHasOptionBeenSet();
} }
#endif #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 { bool GeneralSettings::check() const {
// Ensure that the model was given either symbolically or explicitly. // 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."); STORM_LOG_THROW(!isSymbolicSet() || !isExplicitSet(), storm::exceptions::InvalidSettingsException, "The model may be either given in an explicit or a symbolic format, but not both.");

8
src/settings/modules/GeneralSettings.h

@ -318,6 +318,11 @@ namespace storm {
*/ */
Engine getEngine() const; Engine getEngine() const;
/*!
* Sets the engine for further usage.
*/
void setEngine(Engine);
/*! /*!
* Retrieves whether the PRISM compatibility mode was enabled. * Retrieves whether the PRISM compatibility mode was enabled.
* *
@ -349,11 +354,14 @@ namespace storm {
bool check() const override; bool check() const override;
void finalize() override;
// The name of the module. // The name of the module.
static const std::string moduleName; static const std::string moduleName;
private: private:
Engine engine;
// Define the string names of the options as constants. // Define the string names of the options as constants.
static const std::string helpOptionName; static const std::string helpOptionName;
static const std::string helpOptionShortName; static const std::string helpOptionShortName;

|||||||
100:0
Loading…
Cancel
Save