Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SamplingSettings.cpp
Go to the documentation of this file.
2
7
9
10const std::string SamplingSettings::moduleName = "sampling";
11const std::string samplesOptionName = "samples";
12const std::string samplesGraphPreservingOptionName = "samples-graph-preserving";
13const std::string sampleExactOptionName = "sample-exact";
14const std::string sampleDerivativeOptionName = "sample-derivative";
15
17 this->addOption(
18 storm::settings::OptionBuilder(moduleName, samplesOptionName, false, "The points at which to sample the model.")
19 .addArgument(
21 "samples", "The samples are semicolon-separated entries of the form 'Var1=Val1:Val2:...:Valk,Var2=... that span the sample spaces.")
22 .setDefaultValueString("")
23 .build())
24 .build());
26 "Sets whether it can be assumed that the samples are graph-preserving.")
27 .build());
28 this->addOption(storm::settings::OptionBuilder(moduleName, sampleExactOptionName, false, "Sets whether to sample using exact arithmetic.").build());
29 this->addOption(storm::settings::OptionBuilder(moduleName, sampleDerivativeOptionName, false, "Sets whether to sample the derivatives.").build());
30}
31
32std::string SamplingSettings::getSamples() const {
33 return this->getOption(samplesOptionName).getArgumentByName("samples").getValueAsString();
34}
35
37 return this->getOption(samplesGraphPreservingOptionName).getHasOptionBeenSet();
38}
39
41 return this->getOption(sampleExactOptionName).getHasOptionBeenSet();
42}
43
45 return this->getOption(sampleDerivativeOptionName).getHasOptionBeenSet();
46}
47} // namespace storm::settings::modules
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.
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
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.
bool isSampleDerivativeSet() const
Retrieves whether samples are to be from the derivative.
bool isSampleExactSet() const
Retrieves whether samples are to be computed exactly.
bool isSamplesAreGraphPreservingSet() const
Retrieves whether the samples are graph preserving.
std::string getSamples() const
Retrieves the samples as a comma-separated list of samples for each (relevant) variable,...
const std::string sampleExactOptionName
const std::string samplesGraphPreservingOptionName
const std::string samplesOptionName
const std::string sampleDerivativeOptionName