Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
GlpkSettings.cpp
Go to the documentation of this file.
6
10
11namespace storm {
12namespace settings {
13namespace modules {
14
15const std::string GlpkSettings::moduleName = "glpk";
16const std::string GlpkSettings::integerToleranceOption = "inttol";
17const std::string GlpkSettings::outputOptionName = "output";
18const std::string GlpkSettings::noMilpPresolverOptionName = "nomilppresolver";
19
21 this->addOption(storm::settings::OptionBuilder(moduleName, outputOptionName, true, "If set, the glpk output will be printed to the command line.")
22 .setIsAdvanced()
23 .build());
24 this->addOption(
25 storm::settings::OptionBuilder(moduleName, noMilpPresolverOptionName, true, "Disables glpk's built-in MILP presolver.").setIsAdvanced().build());
26 this->addOption(storm::settings::OptionBuilder(moduleName, integerToleranceOption, true, "Sets glpk's precision for integer variables.")
27 .setIsAdvanced()
28 .addArgument(storm::settings::ArgumentBuilder::createDoubleArgument("value", "The precision to achieve.")
31 .build())
32 .build());
33}
34
36 return this->getOption(outputOptionName).getHasOptionBeenSet();
37}
38
40 return !this->getOption(noMilpPresolverOptionName).getHasOptionBeenSet();
41}
42
44 return this->getOption(integerToleranceOption).getHasOptionBeenSet();
45}
46
48 return this->getOption(integerToleranceOption).getArgumentByName("value").getValueAsDouble();
49}
50
51bool GlpkSettings::check() const {
53 STORM_LOG_WARN_COND(storm::settings::getModule<storm::settings::modules::CoreSettings>().getLpSolver() == storm::solver::LpSolverType::Glpk,
54 "glpk is not selected as the preferred LP solver, so setting options for glpk might have no effect.");
55 }
56
57 return true;
58}
59
60} // namespace modules
61} // namespace settings
62} // namespace storm
virtual double getValueAsDouble() const =0
Retrieves the value of this argument as a double.
static ArgumentBuilder createDoubleArgument(std::string const &name, std::string const &description)
Creates a double argument with the given parameters.
static std::shared_ptr< ArgumentValidator< double > > createDoubleRangeValidatorExcluding(double lowerBound, double upperBound)
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
bool getHasOptionBeenSet() const
Retrieves whether the option has been set.
Definition Option.cpp:125
GlpkSettings()
Creates a new set of glpk settings.
bool isIntegerToleranceSet() const
Retrieves whether the integer tolerance has been set.
bool isOutputSet() const
Retrieves whether the output option was set.
bool isMILPPresolverEnabled() const
Retrieves whether the MILP Presolver should be used.
bool check() const override
Checks whether the settings are consistent.
static const std::string moduleName
double getIntegerTolerance() const
Retrieves the integer tolerance to be used.
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.
#define STORM_LOG_WARN_COND(cond, message)
Definition macros.h:38
SettingsType const & getModule()
Get module.
LabParser.cpp.
Definition cli.cpp:18