Storm 2.0.0.3
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
ScpSettings.cpp
Go to the documentation of this file.
2
4
10
12
13const std::string ScpSettings::moduleName = "scp";
14namespace {
15// The defaults of the options are taken from the library's default-constructed options.
16storm::pars::scp::ScpOptions const defaultOptions;
17
18const std::string trustRegionInitialOption = "trust-region-initial";
19const std::string trustRegionFactorOption = "trust-region-factor";
20const std::string trustRegionMaxOption = "trust-region-max";
21const std::string trustRegionMinExcessOption = "trust-region-min-excess";
22const std::string maxIterationsOption = "max-iterations";
23const std::string initialStateBiasOption = "initial-state-bias";
24const std::string exactOption = "exact-checks";
25const std::string sumViolationObjectiveOption = "sum-violation-objective";
26} // namespace
27
29 this->addOption(storm::settings::OptionBuilder(moduleName, trustRegionInitialOption, false, "The initial trust region radius (delta_0)")
30 .setIsAdvanced()
31 .addArgument(storm::settings::ArgumentBuilder::createDoubleArgument(trustRegionInitialOption, "The initial radius")
32 .setDefaultValueDouble(defaultOptions.trustRegionInitial)
34 .build())
35 .build());
36 this->addOption(storm::settings::OptionBuilder(moduleName, trustRegionFactorOption, false, "The trust region growth/shrink factor (gamma)")
37 .setIsAdvanced()
38 .addArgument(storm::settings::ArgumentBuilder::createDoubleArgument(trustRegionFactorOption, "The factor")
39 .setDefaultValueDouble(defaultOptions.trustRegionFactor)
41 .build())
42 .build());
43 this->addOption(storm::settings::OptionBuilder(moduleName, trustRegionMaxOption, false, "The upper cap on the trust region radius")
44 .setIsAdvanced()
45 .addArgument(storm::settings::ArgumentBuilder::createDoubleArgument(trustRegionMaxOption, "The cap")
46 .setDefaultValueDouble(defaultOptions.trustRegionMax)
48 .build())
49 .build());
50 this->addOption(storm::settings::OptionBuilder(moduleName, trustRegionMinExcessOption, false,
51 "The termination threshold on (trust region radius - 1); the radius asymptotically approaches 1, never 0")
52 .setIsAdvanced()
53 .addArgument(storm::settings::ArgumentBuilder::createDoubleArgument(trustRegionMinExcessOption, "The threshold")
54 .setDefaultValueDouble(defaultOptions.trustRegionMinExcess)
56 .build())
57 .build());
58 this->addOption(storm::settings::OptionBuilder(moduleName, maxIterationsOption, false, "The maximum number of SCP iterations")
59 .setIsAdvanced()
60 .addArgument(storm::settings::ArgumentBuilder::createIntegerArgument(maxIterationsOption, "The maximum number of iterations")
61 .setDefaultValueInteger(defaultOptions.maxIterations)
63 .build())
64 .build());
65 this->addOption(storm::settings::OptionBuilder(moduleName, initialStateBiasOption, false,
66 "The weight of the initial state's value in the LP objective; it breaks ties towards the threshold side")
67 .setIsAdvanced()
68 .addArgument(storm::settings::ArgumentBuilder::createDoubleArgument(initialStateBiasOption, "The weight")
69 .setDefaultValueDouble(defaultOptions.initialStateBias)
71 .build())
72 .build());
73 this->addOption(
74 storm::settings::OptionBuilder(moduleName, exactOption, false, "Sets whether candidate valuations are model-checked using exact arithmetic.").build());
75 this->addOption(storm::settings::OptionBuilder(moduleName, sumViolationObjectiveOption, false,
76 "Minimize the sum of per-state constraint violations instead of the default maximum violation")
77 .setIsAdvanced()
78 .build());
79}
80
82 return this->getOption(trustRegionInitialOption).getArgumentByName(trustRegionInitialOption).getValueAsDouble();
83}
84
86 return this->getOption(trustRegionFactorOption).getArgumentByName(trustRegionFactorOption).getValueAsDouble();
87}
88
90 return this->getOption(trustRegionMaxOption).getArgumentByName(trustRegionMaxOption).getValueAsDouble();
91}
92
94 return this->getOption(trustRegionMinExcessOption).getArgumentByName(trustRegionMinExcessOption).getValueAsDouble();
95}
96
98 return this->getOption(maxIterationsOption).getArgumentByName(maxIterationsOption).getValueAsInteger();
99}
100
102 return this->getOption(initialStateBiasOption).getArgumentByName(initialStateBiasOption).getValueAsDouble();
103}
104
106 return this->getOption(exactOption).getHasOptionBeenSet();
107}
108
110 return this->getOption(sumViolationObjectiveOption).getHasOptionBeenSet();
111}
112
113} // namespace storm::settings::modules
virtual int_fast64_t getValueAsInteger() const =0
Retrieves the value of this argument as an integer.
virtual double getValueAsDouble() const =0
Retrieves the value of this argument as a double.
static ArgumentBuilder createDoubleArgument(std::string const &name, std::string const &description)
Creates a double argument with the given parameters.
static ArgumentBuilder createIntegerArgument(std::string const &name, std::string const &description)
Creates an integer argument with the given parameters.
static std::shared_ptr< ArgumentValidator< double > > createDoubleGreaterValidator(double lowerBound)
static std::shared_ptr< ArgumentValidator< int64_t > > createIntegerGreaterEqualValidator(int_fast64_t lowerBound)
static std::shared_ptr< ArgumentValidator< double > > createDoubleGreaterEqualValidator(double lowerBound)
This class provides the interface to create an option...
std::shared_ptr< Option > build()
Builds an option from the data that was added to this builder.
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.
uint64_t getMaxIterations() const
Retrieves the maximum number of SCP iterations.
double getTrustRegionFactor() const
Retrieves the trust region growth/shrink factor (gamma).
double getInitialStateBias() const
Retrieves the weight of the initial state's value in the LP objective.
bool isSumViolationObjectiveSet() const
Retrieves whether the LP objective should minimize the sum of per-state violations instead of the def...
static const std::string moduleName
Definition ScpSettings.h:56
double getTrustRegionMinExcess() const
Retrieves the termination threshold on (radius - 1).
double getTrustRegionMax() const
Retrieves the upper cap on the trust region radius.
bool isExactSet() const
Retrieves whether candidate valuations are model-checked with exact (rational) arithmetic instead of ...
double getTrustRegionInitial() const
Retrieves the initial trust region radius (delta_0).