Browse Source

Enabling GLPK MILP Presolver by default (again)

tempestpy_adaptions
Tim Quatmann 5 years ago
parent
commit
abdbef06f6
  1. 6
      src/storm/settings/modules/GlpkSettings.cpp
  2. 2
      src/storm/settings/modules/GlpkSettings.h

6
src/storm/settings/modules/GlpkSettings.cpp

@ -15,11 +15,11 @@ namespace storm {
const std::string GlpkSettings::moduleName = "glpk";
const std::string GlpkSettings::integerToleranceOption = "inttol";
const std::string GlpkSettings::outputOptionName = "output";
const std::string GlpkSettings::milpPresolverOptionName = "milppresolver";
const std::string GlpkSettings::noMilpPresolverOptionName = "nomilppresolver";
GlpkSettings::GlpkSettings() : ModuleSettings(moduleName) {
this->addOption(storm::settings::OptionBuilder(moduleName, outputOptionName, true, "If set, the glpk output will be printed to the command line.").setIsAdvanced().build());
this->addOption(storm::settings::OptionBuilder(moduleName, milpPresolverOptionName, true, "Enables glpk's built-in MILP presolver.").setIsAdvanced().build());
this->addOption(storm::settings::OptionBuilder(moduleName, noMilpPresolverOptionName, true, "Disables glpk's built-in MILP presolver.").setIsAdvanced().build());
this->addOption(storm::settings::OptionBuilder(moduleName, integerToleranceOption, true, "Sets glpk's precision for integer variables.").setIsAdvanced().addArgument(storm::settings::ArgumentBuilder::createDoubleArgument("value", "The precision to achieve.").setDefaultValueDouble(1e-06).addValidatorDouble(ArgumentValidatorFactory::createDoubleRangeValidatorExcluding(0.0, 1.0)).build()).build());
}
@ -28,7 +28,7 @@ namespace storm {
}
bool GlpkSettings::isMILPPresolverEnabled() const {
return this->getOption(milpPresolverOptionName).getHasOptionBeenSet();
return !this->getOption(noMilpPresolverOptionName).getHasOptionBeenSet();
}
bool GlpkSettings::isIntegerToleranceSet() const {

2
src/storm/settings/modules/GlpkSettings.h

@ -52,7 +52,7 @@ namespace storm {
// Define the string names of the options as constants.
static const std::string integerToleranceOption;
static const std::string outputOptionName;
static const std::string milpPresolverOptionName;
static const std::string noMilpPresolverOptionName;
};
} // namespace modules

Loading…
Cancel
Save