Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
GeneralSettings.cpp
Go to the documentation of this file.
2
9
11
13
14namespace storm {
15namespace settings {
16namespace modules {
17
18const std::string GeneralSettings::moduleName = "general";
19const std::string GeneralSettings::helpOptionName = "help";
20const std::string GeneralSettings::helpOptionShortName = "h";
21const std::string GeneralSettings::versionOptionName = "version";
22const std::string GeneralSettings::verboseOptionName = "verbose";
23const std::string GeneralSettings::verboseOptionShortName = "v";
24const std::string GeneralSettings::showProgressOptionName = "progress";
25const std::string GeneralSettings::precisionOptionName = "precision";
26const std::string GeneralSettings::precisionOptionShortName = "eps";
27const std::string GeneralSettings::configOptionName = "config";
28const std::string GeneralSettings::configOptionShortName = "c";
29const std::string GeneralSettings::bisimulationOptionName = "bisimulation";
30const std::string GeneralSettings::bisimulationOptionShortName = "bisim";
31const std::string GeneralSettings::parametricOptionName = "parametric";
32const std::string GeneralSettings::exactOptionName = "exact";
33const std::string GeneralSettings::soundOptionName = "sound";
34
36 this->addOption(
37 storm::settings::OptionBuilder(moduleName, helpOptionName, false, "Shows available options, arguments and descriptions.")
38 .setShortName(helpOptionShortName)
39 .addArgument(
41 "filter",
42 "'frequent' for frequently used options, 'all' for the complete help, or a regular expression to show help for all matching entities.")
43 .setDefaultValueString("frequent")
44 .makeOptional()
45 .build())
46 .build());
47 this->addOption(storm::settings::OptionBuilder(moduleName, versionOptionName, false, "Prints the version information.").build());
48 this->addOption(
49 storm::settings::OptionBuilder(moduleName, verboseOptionName, false, "Enables more verbose output.").setShortName(verboseOptionShortName).build());
50 this->addOption(storm::settings::OptionBuilder(moduleName, showProgressOptionName, false,
51 "Sets when additional information (if available) about the progress is printed.")
53 "delay", "The delay to wait (in seconds) between emitting information (0 means never print progress).")
54 .setDefaultValueUnsignedInteger(5)
55 .makeOptional()
56 .build())
57 .build());
58 this->addOption(storm::settings::OptionBuilder(moduleName, precisionOptionName, false, "The internally used precision.")
59 .setShortName(precisionOptionShortName)
60 .addArgument(storm::settings::ArgumentBuilder::createDoubleArgument("value", "The precision to use.")
61 .setDefaultValueDouble(1e-06)
63 .build())
64 .build());
65 this->addOption(
66 storm::settings::OptionBuilder(moduleName, configOptionName, false,
67 "If given, this file will be read and parsed for additional configuration settings.")
68 .setShortName(configOptionShortName)
69 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "The name of the file from which to read the configuration.")
71 .build())
72 .build());
73 this->addOption(storm::settings::OptionBuilder(moduleName, bisimulationOptionName, false, "Sets whether to perform bisimulation minimization.")
74 .setShortName(bisimulationOptionShortName)
75 .build());
76 this->addOption(
77 storm::settings::OptionBuilder(moduleName, parametricOptionName, false, "Sets whether to enable parametric model checking.").setIsAdvanced().build());
78 this->addOption(
79 storm::settings::OptionBuilder(moduleName, exactOptionName, false, "Sets whether to enable exact model checking.")
80 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("valuetype", "The kind of datatype used to represent numeric values")
81 .setDefaultValueString("rationals")
82 .makeOptional()
83 .addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator({"rationals", "floats"}))
84 .build())
85 .build());
86 this->addOption(storm::settings::OptionBuilder(moduleName, soundOptionName, false, "Sets whether to force sound model checking.").build());
87}
88
90 return this->getOption(helpOptionName).getHasOptionBeenSet();
91}
92
94 return this->getOption(versionOptionName).getHasOptionBeenSet();
95}
96
98 return this->getOption(helpOptionName).getArgumentByName("filter").getValueAsString();
99}
100
102 return this->getOption(verboseOptionName).getHasOptionBeenSet();
103}
104
106 return this->getOption(showProgressOptionName).getHasOptionBeenSet();
107}
108
110 return this->getOption(showProgressOptionName).getArgumentByName("delay").getValueAsUnsignedInteger();
111}
112
114 return this->getOption(precisionOptionName).getHasOptionBeenSet();
115}
116
117void GeneralSettings::setPrecision(std::string precision) {
118 this->getOption(precisionOptionName).getArgumentByName("value").setFromStringValue(precision);
119}
121 return this->getOption(precisionOptionName).getArgumentByName("value").getValueAsDouble();
122}
123
125 return this->getOption(configOptionName).getHasOptionBeenSet();
126}
127
129 return this->getOption(configOptionName).getArgumentByName("filename").getValueAsString();
130}
131
133 return this->getOption(bisimulationOptionName).getHasOptionBeenSet();
134}
135
137 return this->getOption(parametricOptionName).getHasOptionBeenSet();
138}
139
141 return this->getOption(exactOptionName).getHasOptionBeenSet() &&
142 this->getOption(exactOptionName).getArgumentByName("valuetype").getValueAsString() == "rationals";
143}
144
146 return this->getOption(exactOptionName).getHasOptionBeenSet() &&
147 this->getOption(exactOptionName).getArgumentByName("valuetype").getValueAsString() == "floats";
148}
149
151 return this->getOption(soundOptionName).getHasOptionBeenSet();
152}
153
155 // Intentionally left empty.
156}
157
159 STORM_LOG_WARN_COND(!this->getOption(precisionOptionName).getHasOptionBeenSetWithModulePrefix(),
160 "Setting the precision option with module prefix does not effect all solvers. Consider setting --"
161 << precisionOptionName << " instead of --" << moduleName << ":" << precisionOptionName << ".");
162 return true;
163}
164
165} // namespace modules
166} // namespace settings
167} // namespace storm
virtual std::string getValueAsString() const =0
Retrieves the value of this argument as a string.
virtual bool setFromStringValue(std::string const &stringValue)=0
Tries to set the value of the argument from the given string.
virtual uint_fast64_t getValueAsUnsignedInteger() const =0
Retrieves the value of this argument as an unsigned integer.
virtual double getValueAsDouble() const =0
Retrieves the value of this argument as a double.
static ArgumentBuilder createUnsignedIntegerArgument(std::string const &name, std::string const &description)
Creates an unsigned integer argument with the given parameters.
static ArgumentBuilder createDoubleArgument(std::string const &name, std::string const &description)
Creates a double argument with the given parameters.
static ArgumentBuilder createStringArgument(std::string const &name, std::string const &description)
Creates a string argument with the given parameters.
static std::shared_ptr< ArgumentValidator< double > > createDoubleRangeValidatorExcluding(double lowerBound, double upperBound)
static std::shared_ptr< ArgumentValidator< std::string > > createMultipleChoiceValidator(std::vector< std::string > const &choices)
static std::shared_ptr< ArgumentValidator< std::string > > createExistingFileValidator()
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
bool isHelpSet() const
Retrieves whether the help option was set.
bool isBisimulationSet() const
Retrieves whether the option to perform bisimulation minimization is set.
uint64_t getShowProgressDelay() const
Retrieves the delay for printing information about the exploration progress.
bool isExactSet() const
Retrieves whether the option enabling exact model checking is set and we should use infinite precisio...
std::string getConfigFilename() const
Retrieves the name of the file that is to be scanned for settings.
void finalize() override
Prepares the modules for further usage, should be called at the end of the initialization,...
bool isVerboseSet() const
Retrieves whether the verbose option was set.
bool isParametricSet() const
Retrieves whether the option enabling parametric model checking is set.
bool isVersionSet() const
Retrieves whether the version option was set.
bool isSoundSet() const
Retrieves whether the option forcing soundnet is set.
bool isExactFinitePrecisionSet() const
Retrieves whether the option enabling exact model checking is set.
bool isShowProgressSet() const
Retrieves whether the progress option was set.
std::string getHelpFilterExpression() const
Retrieves the name of the module for which to show the help or "all" to indicate that the full help n...
bool isConfigSet() const
Retrieves whether the config option was set.
bool check() const override
Checks whether the settings are consistent.
GeneralSettings()
Creates a new set of general settings.
double getPrecision() const
Retrieves the precision to use for numerical operations.
ModuleSettings(std::string const &moduleName)
Constructs a new settings object.
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:36