Storm 2.0.0.3
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
CertificationSettings.cpp
Go to the documentation of this file.
2
8
10
11const std::string CertificationSettings::moduleName = "cert";
12
13const std::string CertificationSettings::produceCertificateOptionName = "certificate";
14const std::string CertificationSettings::useTopologicalOptionName = "topological";
15const std::string CertificationSettings::methodOptionName = "method";
16
18 this->addOption(
19 storm::settings::OptionBuilder(moduleName, produceCertificateOptionName, false, "If set, a certificate will be produced (if supported).").build());
20
21 this->addOption(
22 storm::settings::OptionBuilder(moduleName, useTopologicalOptionName, false, "If set, uses topological methods to produce certificates.").build());
23 std::vector<std::string> const methodNames = {"fp-ii", "fp-smoothii", "fp-roundii", "ex-pi"};
24 this->addOption(storm::settings::OptionBuilder(moduleName, methodOptionName, true, "The method to use for certification.")
25 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("name", "The name of the method to use.")
26 .setDefaultValueString("fp-ii")
27 .addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(methodNames))
28 .build())
29 .addArgument(storm::settings::ArgumentBuilder::createDoubleArgument("gamma", "The gamma value for the method.")
30 .setDefaultValueDouble(0.0)
31 .makeOptional()
33 .build())
34 .addArgument(storm::settings::ArgumentBuilder::createDoubleArgument("delta", "The delta value for the method.")
35 .setDefaultValueDouble(0.0)
36 .makeOptional()
38 .build())
39 .build());
40}
41
43 return this->getOption(produceCertificateOptionName).getHasOptionBeenSet();
44}
45
47 return this->getOption(useTopologicalOptionName).getHasOptionBeenSet();
48}
49
51 return storm::certificateAlgorithmFromString(this->getOption(methodOptionName).getArgumentByName("name").getValueAsString());
52}
53
55 return this->getOption(methodOptionName).getArgumentByName("gamma").getValueAsDouble();
56}
57
59 return this->getOption(methodOptionName).getArgumentByName("delta").getValueAsDouble();
60}
61
63 if (this->getOption(methodOptionName).getHasOptionBeenSet()) {
64 auto const algorithm = getAlgorithm();
66 // For gamma = 1, the bounds are never updated, so the iteration would not terminate.
67 STORM_LOG_THROW(getGamma() < 1.0, storm::exceptions::InvalidSettingsException,
68 "The parameter gamma for smooth and rounding interval iteration must be smaller than 1.");
69 }
70 }
71 return true;
72}
73
74} // namespace storm::settings::modules
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 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)
static std::shared_ptr< ArgumentValidator< double > > createDoubleRangeValidatorIncluding(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
double getDelta() const
The delta parameter of the algorithm.
storm::CertificateAlgorithm getAlgorithm() const
The algorithm used to compute the values underlying a certificate.
bool isProduceCertificateSet() const
Whether a certificate is to be produced.
bool check() const override
Checks whether the settings are consistent.
bool isUseTopologicalSet() const
Whether topological methods are used to produce certificates.
double getGamma() const
The gamma parameter of the algorithm.
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_THROW(cond, exception, message)
Definition macros.h:39
CertificateAlgorithm
The algorithms that can be used to compute the values underlying a certificate.
@ FpRoundII
Smooth interval iteration with floating point numbers.
@ FpSmoothII
Interval iteration with floating point numbers.
CertificateAlgorithm certificateAlgorithmFromString(std::string const &algorithm)