Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
TimeBoundedSolverSettings.cpp
Go to the documentation of this file.
2
6
8
9namespace storm {
10namespace settings {
11namespace modules {
12
13const std::string TimeBoundedSolverSettings::moduleName = "timebounded";
14
15const std::string TimeBoundedSolverSettings::maMethodOptionName = "mamethod";
16const std::string TimeBoundedSolverSettings::precisionOptionName = "precision";
17const std::string TimeBoundedSolverSettings::absoluteOptionName = "absolute";
18const std::string TimeBoundedSolverSettings::unifPlusKappaOptionName = "kappa";
19
21 std::vector<std::string> maMethods = {"imca", "unifplus"};
22 this->addOption(storm::settings::OptionBuilder(moduleName, maMethodOptionName, false, "The method to use to solve bounded reachability queries on MAs.")
23 .setIsAdvanced()
24 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("name", "The name of the method to use.")
26 .setDefaultValueString("unifplus")
27 .build())
28 .build());
29
30 this->addOption(storm::settings::OptionBuilder(moduleName, precisionOptionName, false, "The precision used for detecting convergence of iterative methods.")
31 .setIsAdvanced()
32 .addArgument(storm::settings::ArgumentBuilder::createDoubleArgument("value", "The precision to achieve.")
35 .build())
36 .build());
37
38 this->addOption(storm::settings::OptionBuilder(moduleName, absoluteOptionName, false,
39 "Sets whether the relative or the absolute error is considered for detecting convergence.")
40 .setIsAdvanced()
41 .build());
42
43 this->addOption(
44 storm::settings::OptionBuilder(moduleName, unifPlusKappaOptionName, false, "Controls which amount of the approximation error is due to truncation.")
45 .setIsAdvanced()
46 .addArgument(storm::settings::ArgumentBuilder::createDoubleArgument("kappa", "The factor")
49 .build())
50 .build());
51}
52
54 return this->getOption(precisionOptionName).getHasOptionBeenSet();
55}
56
58 return this->getOption(precisionOptionName).getArgumentByName("value").getValueAsDouble();
59}
60
62 return !this->getOption(absoluteOptionName).getHasOptionBeenSet();
63}
64
65storm::solver::MaBoundedReachabilityMethod TimeBoundedSolverSettings::getMaMethod() const {
66 std::string techniqueAsString = this->getOption(maMethodOptionName).getArgumentByName("name").getValueAsString();
67 if (techniqueAsString == "imca") {
68 return storm::solver::MaBoundedReachabilityMethod::Imca;
69 }
70 return storm::solver::MaBoundedReachabilityMethod::UnifPlus;
71}
72
74 return !this->getOption(maMethodOptionName).getArgumentByName("name").getHasBeenSet() ||
75 this->getOption(maMethodOptionName).getArgumentByName("name").wasSetFromDefaultValue();
76}
77
79 return this->getOption(unifPlusKappaOptionName).getArgumentByName("kappa").getValueAsDouble();
80}
81
82} // namespace modules
83} // namespace settings
84} // 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 double getValueAsDouble() const =0
Retrieves the value of this argument as a double.
virtual bool wasSetFromDefaultValue() const =0
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)
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
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.
double getPrecision() const
Retrieves the precision that is used for detecting convergence.
bool isRelativePrecision() const
Retrieves whether the convergence criterion has been set to relative or absolute.
storm::solver::MaBoundedReachabilityMethod getMaMethod() const
Retrieves the selected solving technique for time bounded reachability on Markov Automata.
double getUnifPlusKappa() const
Retrieves the truncation factor used for unifPlus.
bool isMaMethodSetFromDefaultValue() const
Retrieves whether solving technique for time bounded reachability on Markov Automata has been set fro...
bool isPrecisionSet() const
Retrieves whether the precision has been set.
SettingsType const & getModule()
Get module.
LabParser.cpp.
Definition cli.cpp:18