Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
ConversionOutputSettings.cpp
Go to the documentation of this file.
2
8
11
12namespace storm {
13namespace settings {
14namespace modules {
15
16const std::string ConversionOutputSettings::moduleName = "output";
17const std::string ConversionOutputSettings::janiOutputOptionName = "tojani";
18const std::string ConversionOutputSettings::prismOutputOptionName = "toprism";
19
21 this->addOption(storm::settings::OptionBuilder(moduleName, janiOutputOptionName, false, "exports the model as Jani file.")
22 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "the name of the output file (if not empty).")
24 .build())
25 .build());
26 this->addOption(storm::settings::OptionBuilder(moduleName, prismOutputOptionName, false, "exports the model as Prism file.")
27 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "the name of the output file (if not empty).")
29 .build())
30 .build());
31}
32
34 return this->getOption(janiOutputOptionName).getHasOptionBeenSet();
35}
36
38 return isJaniOutputSet() && !this->getOption(janiOutputOptionName).getArgumentByName("filename").wasSetFromDefaultValue() &&
39 this->getOption(janiOutputOptionName).getArgumentByName("filename").getHasBeenSet() &&
40 this->getOption(janiOutputOptionName).getArgumentByName("filename").getValueAsString() != "";
41}
42
44 STORM_LOG_THROW(isJaniOutputFilenameSet(), storm::exceptions::InvalidOperationException, "Tried to get the jani output name although none was specified.");
45 return this->getOption(janiOutputOptionName).getArgumentByName("filename").getValueAsString();
46}
47
49 return this->getOption(prismOutputOptionName).getHasOptionBeenSet();
50}
51
53 return isPrismOutputSet() && !this->getOption(prismOutputOptionName).getArgumentByName("filename").wasSetFromDefaultValue() &&
54 this->getOption(prismOutputOptionName).getArgumentByName("filename").getHasBeenSet() &&
55 this->getOption(prismOutputOptionName).getArgumentByName("filename").getValueAsString() != "";
56}
57
59 STORM_LOG_THROW(isPrismOutputFilenameSet(), storm::exceptions::InvalidOperationException,
60 "Tried to get the prism output name although none was specified.");
61 return this->getOption(prismOutputOptionName).getArgumentByName("filename").getValueAsString();
62}
63
65 // Intentionally left empty.
66}
67
70 storm::exceptions::InvalidSettingsException, "Unable to write at file " + getJaniOutputFilename());
72 storm::exceptions::InvalidSettingsException, "Unable to write at file " + getPrismOutputFilename());
73 STORM_LOG_THROW(!(isJaniOutputSet() && isPrismOutputSet()), storm::exceptions::InvalidSettingsException, "Can not export to both, prism and jani");
74 return true;
75}
76
77} // namespace modules
78} // namespace settings
79} // namespace storm
virtual std::string getValueAsString() const =0
Retrieves the value of this argument as a string.
virtual bool getHasBeenSet() const
Retrieves whether the argument has been set.
virtual bool wasSetFromDefaultValue() const =0
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 > > 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
bool isPrismOutputSet() const
Retrieves whether the output should be in the Prism format.
bool isJaniOutputFilenameSet() const
Retrieves whether an output filename for the jani file was specified.
bool isPrismOutputFilenameSet() const
Retrieves whether an output filename for the prism file was specified.
void finalize() override
Prepares the modules for further usage, should be called at the end of the initialization,...
std::string getPrismOutputFilename() const
Retrieves the name of the prism output (if specified)
bool isJaniOutputSet() const
Retrieves whether the output should be in the Jani format.
bool check() const override
Checks whether the settings are consistent.
std::string getJaniOutputFilename() const
Retrieves the name of the jani output (if specified)
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.
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
SettingsType const & getModule()
Get module.
LabParser.cpp.
Definition cli.cpp:18