Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
RegionVerificationSettings.cpp
Go to the documentation of this file.
2
7
10
12
13const std::string RegionVerificationSettings::moduleName = "regionverif";
14const std::string splittingThresholdName = "splitting-threshold";
15const std::string splittingHeuristicName = "splitting-heuristic";
16const std::string estimateMethodName = "estimate-method";
17const std::string checkEngineOptionName = "engine";
18
20 this->addOption(
21 storm::settings::OptionBuilder(moduleName, splittingThresholdName, false, "Sets the threshold for number of parameters in which to split regions.")
22 .addArgument(
23 storm::settings::ArgumentBuilder::createIntegerArgument("splitting-threshold", "The threshold for splitting, should be an integer > 0").build())
24 .build());
25
26 std::vector<std::string> strategies = {"estimate", "roundrobin", "default"};
27 this->addOption(storm::settings::OptionBuilder(moduleName, splittingHeuristicName, false, "Sets which strategy is used for splitting regions.")
28 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("name", "The name of the strategy to use.")
29 .addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(strategies))
30 .setDefaultValueString("default")
31 .build())
32 .build());
33
34 std::vector<std::string> estimates = {"delta", "distance", "deltaweighted", "derivative"};
36 "Sets which estimate strategy is used for splitting regions (if splitting-stratgegy is estimate).")
37 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("name", "The name of the strategy to use.")
39 .setDefaultValueString("delta")
40 .build())
41 .build());
42
43 std::vector<std::string> engines = {"pl", "exactpl", "validatingpl", "robustpl"};
44 this->addOption(storm::settings::OptionBuilder(moduleName, checkEngineOptionName, true, "Sets which engine is used for analyzing regions.")
45 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("name", "The name of the engine to use.")
47 .setDefaultValueString("pl")
48 .build())
49 .build());
50}
51
53 return this->getOption(splittingThresholdName).getArgumentByName("splitting-threshold").getValueAsInteger();
54}
55
57 return this->getOption(splittingThresholdName).getHasOptionBeenSet();
58}
59
61 std::string engineString = this->getOption(checkEngineOptionName).getArgumentByName("name").getValueAsString();
62
64 if (engineString == "pl") {
66 } else if (engineString == "exactpl") {
68 } else if (engineString == "validatingpl") {
70 } else if (engineString == "robustpl") {
72 } else {
73 STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentValueException, "Unknown region check engine '" << engineString << "'.");
74 }
75
76 return result;
77}
78
80 std::string strategyString = this->getOption(splittingHeuristicName).getArgumentByName("name").getValueAsString();
81
83 if (strategyString == "default") {
85 } else if (strategyString == "estimate") {
87 } else if (strategyString == "roundrobin") {
89 } else {
90 STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentValueException, "Unknown splitting strategy '" << strategyString << "'.");
91 }
92
94 "Setting an estimate method requires setting the estimate splitting strategy");
95 return result;
96}
97
98std::optional<storm::modelchecker::RegionSplitEstimateKind> RegionVerificationSettings::getRegionSplittingEstimateMethod() const {
99 if (!this->getOption(estimateMethodName).getHasOptionBeenSet()) {
100 return std::nullopt;
101 }
102 std::string strategyString = this->getOption(estimateMethodName).getArgumentByName("name").getValueAsString();
103
105 if (strategyString == "delta") {
107 } else if (strategyString == "deltaweighted") {
109 } else if (strategyString == "distance") {
111 } else if (strategyString == "derivative") {
113 } else {
114 STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentValueException, "Unknown splitting strategy '" << strategyString << "'.");
115 }
116
117 return result;
118}
119
120} // namespace storm::settings::modules
virtual std::string getValueAsString() const =0
Retrieves the value of this argument as a string.
virtual int_fast64_t getValueAsInteger() const =0
Retrieves the value of this argument as an integer.
static ArgumentBuilder createIntegerArgument(std::string const &name, std::string const &description)
Creates an integer 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)
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.
std::optional< storm::modelchecker::RegionSplitEstimateKind > getRegionSplittingEstimateMethod() const
Retrieves which type of region splitting strategy should be used.
storm::modelchecker::RegionCheckEngine getRegionCheckEngine() const
Retrieves which type of region check should be performed.
storm::modelchecker::RegionSplittingStrategy::Heuristic getRegionSplittingHeuristic() const
Retrieves which type of region splitting strategy should be used.
#define STORM_LOG_ERROR_COND(cond, message)
Definition macros.h:52
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
RegionCheckEngine
The considered engine for region checking.
@ ParameterLifting
Parameter lifting approach.
@ ValidatingParameterLifting
Parameter lifting approach with a) inexact (and fast) computation first and b) exact validation of ob...
@ RobustParameterLifting
Parameter lifting approach based on robust markov models instead of generating nondeterminism.
@ ExactParameterLifting
Parameter lifting approach with exact arithmethics.