Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
ParametricSettings.cpp
Go to the documentation of this file.
2
7
10
11namespace storm {
12namespace settings {
13namespace modules {
14
15const std::string ParametricSettings::moduleName = "parametric";
16const std::string modeOptionName = "mode";
17const std::string directionOptionName = "direction";
18const std::string exportResultOptionName = "resultfile";
19const std::string transformContinuousOptionName = "transformcontinuous";
20const std::string transformContinuousShortOptionName = "tc";
21const std::string useMonotonicityName = "use-monotonicity";
22const std::string timeTravellingEnabledName = "time-travel";
23const std::string linearToSimpleEnabledName = "linear-to-simple";
24
26 std::vector<std::string> modes = {"feasibility", "verification", "monotonicity", "sampling", "solutionfunction", "partitioning"};
27 this->addOption(storm::settings::OptionBuilder(moduleName, modeOptionName, false, "What type of parametric analysis do you want to do?")
28 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("mode", "What to do?")
30 .build())
31 .build());
32 this->addOption(storm::settings::OptionBuilder(moduleName, exportResultOptionName, false, "A path to a file where the parametric result should be saved.")
33 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("path", "the location.")
35 .build())
36 .build());
38 "Sets whether to transform a continuous time input model to a discrete time model.")
40 .build());
41 this->addOption(storm::settings::OptionBuilder(moduleName, useMonotonicityName, false, "If set, monotonicity will be used.").build());
42 this->addOption(
43 storm::settings::OptionBuilder(moduleName, timeTravellingEnabledName, false, "Enabled time travelling (flip transitions to improve PLA bounds).")
44 .build());
46 "Converts linear (constant * parameter) transitions to simple (only constant or parameter) transitions.")
47 .build());
48}
49
51 return this->getOption(exportResultOptionName).getHasOptionBeenSet();
52}
53
55 return this->getOption(exportResultOptionName).getArgumentByName("path").getValueAsString();
56}
57
59 return this->getOption(transformContinuousOptionName).getHasOptionBeenSet();
60}
61
63 return this->getOption(useMonotonicityName).getHasOptionBeenSet();
64}
65
67 return this->getOption(modeOptionName).getHasOptionBeenSet();
68}
69
71 auto mode = pars::utility::getParametricModeFromString(this->getOption(modeOptionName).getArgumentByName("mode").getValueAsString());
72 STORM_LOG_THROW(mode, storm::exceptions::IllegalArgumentException, "Parametric mode is not properly implemented");
73 return *mode;
74}
75
77 return this->getOption(timeTravellingEnabledName).getHasOptionBeenSet();
78}
79
81 return this->getOption(linearToSimpleEnabledName).getHasOptionBeenSet();
82}
83
84} // namespace modules
85} // namespace settings
86} // namespace storm
virtual std::string getValueAsString() const =0
Retrieves the value of this argument as a string.
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< std::string > > createWritableFileValidator()
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.
bool isLinearToSimpleEnabled() const
Retrieves whether time-travelling should be enabled.
bool exportResultToFile() const
Retrieves whether the model checking result should be exported to a file.
ParametricSettings()
Creates a new set of parametric model checking settings.
std::string exportResultPath() const
The path to a file location which should contain the model checking result.
bool isTimeTravellingEnabled() const
Retrieves whether time-travelling should be enabled.
bool isUseMonotonicitySet() const
Retrieves whether monotonicity should be used as preprocessing.
pars::utility::ParametricMode getOperationMode() const
In what operation mode should storm-pars run.
bool transformContinuousModel() const
Retrieves whether Continuous time models should be transformed to discrete time models.
bool hasOperationModeBeenSet() const
Has the operation mode (feasibility, verification, etc) been set?
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
std::optional< ParametricMode > getParametricModeFromString(std::string const &input)
const std::string useMonotonicityName
const std::string directionOptionName
const std::string linearToSimpleEnabledName
const std::string timeTravellingEnabledName
const std::string transformContinuousShortOptionName
const std::string transformContinuousOptionName
const std::string exportResultOptionName
SettingsType const & getModule()
Get module.
LabParser.cpp.
Definition cli.cpp:18