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 {
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.");

8
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;

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