Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
ResourceSettings.cpp
Go to the documentation of this file.
2
8
9namespace storm {
10namespace settings {
11namespace modules {
12
13const std::string ResourceSettings::moduleName = "resources";
14const std::string ResourceSettings::timeoutOptionName = "timeout";
15const std::string ResourceSettings::timeoutOptionShortName = "t";
16const std::string ResourceSettings::printTimeAndMemoryOptionName = "timemem";
17const std::string ResourceSettings::printTimeAndMemoryOptionShortName = "tm";
18const std::string ResourceSettings::signalWaitingTimeOptionName = "signal-timeout";
19
21 this->addOption(storm::settings::OptionBuilder(moduleName, timeoutOptionName, false, "If given, computation will abort after the timeout has been reached.")
22 .setIsAdvanced()
23 .setShortName(timeoutOptionShortName)
24 .addArgument(storm::settings::ArgumentBuilder::createUnsignedIntegerArgument("time", "Seconds after which to timeout.")
26 .build())
27 .build());
28 this->addOption(storm::settings::OptionBuilder(moduleName, printTimeAndMemoryOptionName, false, "Prints CPU time and memory consumption at the end.")
29 .setShortName(printTimeAndMemoryOptionShortName)
30 .build());
31 this->addOption(storm::settings::OptionBuilder(moduleName, signalWaitingTimeOptionName, false,
32 "Specifies how much time can pass until termination when receiving a termination signal.")
33 .setIsAdvanced()
34 .addArgument(storm::settings::ArgumentBuilder::createUnsignedIntegerArgument("time", "Seconds after which to exit the program.")
36 .build())
37 .build());
38}
39
41 return this->getOption(timeoutOptionName).getHasOptionBeenSet();
42}
43
47
49 return this->getOption(printTimeAndMemoryOptionName).getHasOptionBeenSet();
50}
51
55
56} // namespace modules
57} // namespace settings
58} // namespace storm
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.
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 isPrintTimeAndMemorySet() const
Retrieves whether time and memory consumption shall be printed at the end of a run.
uint_fast64_t getTimeoutInSeconds() const
Retrieves the time after which the computation has to be aborted in case the timeout option was set.
uint_fast64_t getSignalWaitingTimeInSeconds() const
Retrieves the waiting time of the program after a signal.
bool isTimeoutSet() const
Retrieves whether the timeout option was set.
ResourceSettings()
Creates a new set of general settings.
SettingsType const & getModule()
Get module.
LabParser.cpp.
Definition cli.cpp:18