Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
MultiplierSettings.cpp
Go to the documentation of this file.
2
6
9
10namespace storm {
11namespace settings {
12namespace modules {
13
14const std::string MultiplierSettings::moduleName = "multiplier";
15const std::string MultiplierSettings::multiplierTypeOptionName = "type";
16
18 std::vector<std::string> multiplierTypes = {"native", "gmmxx"};
19 this->addOption(storm::settings::OptionBuilder(moduleName, multiplierTypeOptionName, true, "Sets which type of multiplier is preferred.")
20 .setIsAdvanced()
21 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("name", "The name of a multiplier.")
23 .setDefaultValueString("gmmxx")
24 .build())
25 .build());
26}
27
28storm::solver::MultiplierType MultiplierSettings::getMultiplierType() const {
29 std::string type = this->getOption(multiplierTypeOptionName).getArgumentByName("name").getValueAsString();
30 if (type == "native") {
31 return storm::solver::MultiplierType::Native;
32 } else if (type == "gmmxx") {
33 return storm::solver::MultiplierType::Gmmxx;
34 }
35
36 STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentValueException, "Unknown multiplier type '" << type << "'.");
37}
38
40 return !this->getOption(multiplierTypeOptionName).getArgumentByName("name").getHasBeenSet() ||
41 this->getOption(multiplierTypeOptionName).getArgumentByName("name").wasSetFromDefaultValue();
42}
43} // namespace modules
44} // namespace settings
45} // namespace storm
virtual std::string getValueAsString() const =0
Retrieves the value of this argument as a string.
virtual bool getHasBeenSet() const
Retrieves whether the argument has been set.
virtual bool wasSetFromDefaultValue() const =0
static ArgumentBuilder createStringArgument(std::string const &name, std::string const &description)
Creates a string argument with the given parameters.
static std::shared_ptr< ArgumentValidator< std::string > > createMultipleChoiceValidator(std::vector< std::string > const &choices)
This class provides the interface to create an option...
ArgumentBase const & getArgumentByName(std::string const &argumentName) const
Returns a reference to the argument with the specified long name.
Definition Option.cpp:79
This is the base class of the settings for a particular module.
void addOption(std::shared_ptr< Option > const &option)
Adds and registers the given option.
Option & getOption(std::string const &longName)
Retrieves the option with the given long name.
storm::solver::MultiplierType getMultiplierType() const
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
SettingsType const & getModule()
Get module.
LabParser.cpp.
Definition cli.cpp:18