Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
DftGspnSettings.cpp
Go to the documentation of this file.
1#include "DftGspnSettings.h"
2
10
11namespace storm::dft {
12namespace settings {
13namespace modules {
14
15const std::string DftGspnSettings::moduleName = "dftGspn";
16const std::string DftGspnSettings::transformToGspnOptionName = "to-gspn";
17const std::string DftGspnSettings::disableSmartTransformationOptionName = "disable-smart";
18const std::string DftGspnSettings::mergeDCFailedOptionName = "merge-dc-failed";
19const std::string DftGspnSettings::extendPrioritiesOptionName = "extend-priorities";
20const std::string DftGspnSettings::writeToJaniOptionName = "to-jani";
21
22DftGspnSettings::DftGspnSettings() : ModuleSettings(moduleName) {
23 this->addOption(storm::settings::OptionBuilder(moduleName, transformToGspnOptionName, false, "Transform DFT to GSPN.").build());
24 this->addOption(storm::settings::OptionBuilder(moduleName, disableSmartTransformationOptionName, false, "Disable smart transformation.").build());
25 this->addOption(
26 storm::settings::OptionBuilder(moduleName, mergeDCFailedOptionName, false, "Enable merging of Don't Care and Failed places into a combined place.")
27 .build());
28 this->addOption(
29 storm::settings::OptionBuilder(moduleName, extendPrioritiesOptionName, false, "Enable experimental calculation of transition priorities").build());
30 this->addOption(storm::settings::OptionBuilder(moduleName, writeToJaniOptionName, false, "Destination for the jani output")
31 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "path to file").build())
32 .build());
33}
34
36 return this->getOption(transformToGspnOptionName).getHasOptionBeenSet();
37}
38
40 return this->getOption(disableSmartTransformationOptionName).getHasOptionBeenSet();
41}
42
44 return this->getOption(mergeDCFailedOptionName).getHasOptionBeenSet();
45}
46
48 return this->getOption(extendPrioritiesOptionName).getHasOptionBeenSet();
49}
50
52 return this->getOption(writeToJaniOptionName).getHasOptionBeenSet();
53}
54
56 return this->getOption(writeToJaniOptionName).getArgumentByName("filename").getValueAsString();
57}
58
60
62 // Ensure that GSPN option is set if other options are set.
63 STORM_LOG_THROW(isTransformToGspn() || (!isDisableSmartTransformation() && !isMergeDCFailed()), storm::exceptions::InvalidSettingsException,
64 "GSPN transformation should be enabled when giving options for the transformation.");
65 return true;
66}
67
68} // namespace modules
69} // namespace settings
70} // namespace storm::dft
bool isExtendPriorities() const
Retrieves whether the experimental setting of priorities should be used.
void finalize() override
Prepares the modules for further usage, should be called at the end of the initialization,...
bool check() const override
Checks whether the settings are consistent.
bool isDisableSmartTransformation() const
Retrieves whether the smart transformation should be disabled.
bool isWriteToJaniSet() const
Retrieves whether the GSPN should be exported as a Jani file.
bool isTransformToGspn() const
Retrieves whether the DFT should be transformed into a GSPN.
DftGspnSettings()
Creates a new set of DFT-GSPN settings.
bool isMergeDCFailed() const
Retrieves whether the DC and failed place should be merged.
std::string getWriteToJaniFilename() const
Retrieves the jani filename for export.
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
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