Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
EliminationSettings.cpp
Go to the documentation of this file.
2
7
10
11namespace storm {
12namespace settings {
13namespace modules {
14
15const std::string EliminationSettings::moduleName = "elimination";
16const std::string EliminationSettings::eliminationMethodOptionName = "method";
17const std::string EliminationSettings::eliminationOrderOptionName = "order";
18const std::string EliminationSettings::entryStatesLastOptionName = "entrylast";
19const std::string EliminationSettings::maximalSccSizeOptionName = "sccsize";
20const std::string EliminationSettings::useDedicatedModelCheckerOptionName = "use-dedicated-mc";
21
23 std::vector<std::string> orders = {"fw", "fwrev", "bw", "bwrev", "rand", "spen", "dpen", "regex"};
24 this->addOption(
25 storm::settings::OptionBuilder(moduleName, eliminationOrderOptionName, true, "The order that is to be used for the elimination techniques.")
26 .setIsAdvanced()
27 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("name", "The name of the order in which states are chosen for elimination.")
29 .setDefaultValueString("fwrev")
30 .build())
31 .build());
32
33 std::vector<std::string> methods = {"state", "hybrid"};
34 this->addOption(storm::settings::OptionBuilder(moduleName, eliminationMethodOptionName, true, "The elimination technique to use.")
35 .setIsAdvanced()
36 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("name", "The name of the elimination technique to use.")
38 .setDefaultValueString("state")
39 .build())
40 .build());
41
42 this->addOption(storm::settings::OptionBuilder(moduleName, entryStatesLastOptionName, true, "Sets whether the entry states are eliminated last.")
43 .setIsAdvanced()
44 .build());
45 this->addOption(
46 storm::settings::OptionBuilder(moduleName, maximalSccSizeOptionName, true, "Sets the maximal size of the SCCs for which state elimination is applied.")
47 .setIsAdvanced()
48 .addArgument(
49 storm::settings::ArgumentBuilder::createUnsignedIntegerArgument("maxsize", "The maximal size of an SCC on which state elimination is applied.")
51 .build())
52 .build());
53 this->addOption(storm::settings::OptionBuilder(moduleName, useDedicatedModelCheckerOptionName, true,
54 "Sets whether to use the dedicated model elimination checker (only DTMCs).")
55 .setIsAdvanced()
56 .build());
57}
58
60 std::string eliminationMethodAsString = this->getOption(eliminationMethodOptionName).getArgumentByName("name").getValueAsString();
61 if (eliminationMethodAsString == "state") {
63 } else if (eliminationMethodAsString == "hybrid") {
65 } else {
66 STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentValueException, "Illegal elimination method selected.");
67 }
68}
69
71 std::string eliminationOrderAsString = this->getOption(eliminationOrderOptionName).getArgumentByName("name").getValueAsString();
72 if (eliminationOrderAsString == "fw") {
74 } else if (eliminationOrderAsString == "fwrev") {
76 } else if (eliminationOrderAsString == "bw") {
78 } else if (eliminationOrderAsString == "bwrev") {
80 } else if (eliminationOrderAsString == "rand") {
82 } else if (eliminationOrderAsString == "spen") {
84 } else if (eliminationOrderAsString == "dpen") {
86 } else if (eliminationOrderAsString == "regex") {
88 } else {
89 STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentValueException, "Illegal elimination order selected.");
90 }
91}
92
94 return this->getOption(entryStatesLastOptionName).getHasOptionBeenSet();
95}
96
98 return this->getOption(maximalSccSizeOptionName).getArgumentByName("maxsize").getValueAsUnsignedInteger();
99}
100
102 return this->getOption(useDedicatedModelCheckerOptionName).getHasOptionBeenSet();
103}
104} // namespace modules
105} // namespace settings
106} // namespace storm
virtual std::string getValueAsString() const =0
Retrieves the value of this argument as a string.
virtual uint_fast64_t getValueAsUnsignedInteger() const =0
Retrieves the value of this argument as an unsigned integer.
static ArgumentBuilder createUnsignedIntegerArgument(std::string const &name, std::string const &description)
Creates an unsigned 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
EliminationOrder
An enum that contains all available state elimination orders.
bool isEliminateEntryStatesLastSet() const
Retrieves whether the option to eliminate entry states in the very end is set.
EliminationMethod getEliminationMethod() const
Retrieves the selected elimination method.
EliminationOrder getEliminationOrder() const
Retrieves the selected elimination order.
EliminationSettings()
Creates a new set of parametric model checking settings.
uint_fast64_t getMaximalSccSize() const
Retrieves the maximal size of an SCC on which state elimination is to be directly applied.
EliminationMethod
An enum that contains all available elimination methods.
bool isUseDedicatedModelCheckerSet() const
Retrieves whether the dedicated model checker is to be used instead of the general on.
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.
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
SettingsType const & getModule()
Get module.
LabParser.cpp.
Definition cli.cpp:18