diff --git a/src/builder/ExplicitDFTModelBuilder.cpp b/src/builder/ExplicitDFTModelBuilder.cpp index 7cf1488be..4d794cb2f 100644 --- a/src/builder/ExplicitDFTModelBuilder.cpp +++ b/src/builder/ExplicitDFTModelBuilder.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "src/settings/modules/DebugSettings.h" +#include "src/settings/modules/DFTSettings.h" #include "src/settings/SettingsManager.h" #include @@ -226,7 +226,7 @@ namespace storm { STORM_LOG_ASSERT(nextBEPair.second == hasDependencies, "Failure due to dependencies does not match."); STORM_LOG_TRACE("With the failure of: " << nextBE->name() << " [" << nextBE->id() << "] in " << mDft.getStateString(state)); - if (storm::settings::getModule().isTestSet()) { + if (storm::settings::getModule().computeApproximation()) { if (!storm::utility::isZero(exitRate)) { ValueType rate = nextBE->activeFailureRate(); ValueType div = rate / exitRate; diff --git a/src/settings/modules/DFTSettings.cpp b/src/settings/modules/DFTSettings.cpp index 4df95987c..416a8a5af 100644 --- a/src/settings/modules/DFTSettings.cpp +++ b/src/settings/modules/DFTSettings.cpp @@ -21,6 +21,8 @@ namespace storm { const std::string DFTSettings::symmetryReductionOptionShortName = "symred"; const std::string DFTSettings::modularisationOptionName = "modularisation"; const std::string DFTSettings::disableDCOptionName = "disabledc"; + const std::string DFTSettings::computeApproximationOptionName = "approximation"; + const std::string DFTSettings::computeApproximationOptionShortName = "approx"; const std::string DFTSettings::propExpectedTimeOptionName = "expectedtime"; const std::string DFTSettings::propExpectedTimeOptionShortName = "mttf"; const std::string DFTSettings::propProbabilityOptionName = "probability"; @@ -37,6 +39,7 @@ namespace storm { this->addOption(storm::settings::OptionBuilder(moduleName, symmetryReductionOptionName, false, "Exploit symmetric structure of model.").setShortName(symmetryReductionOptionShortName).build()); this->addOption(storm::settings::OptionBuilder(moduleName, modularisationOptionName, false, "Use modularisation (not applicable for expected time).").build()); this->addOption(storm::settings::OptionBuilder(moduleName, disableDCOptionName, false, "Disable Dont Care propagation.").build()); + this->addOption(storm::settings::OptionBuilder(moduleName, computeApproximationOptionName, false, "Compute an approximation.").setShortName(computeApproximationOptionShortName).build()); this->addOption(storm::settings::OptionBuilder(moduleName, propExpectedTimeOptionName, false, "Compute expected time of system failure.").setShortName(propExpectedTimeOptionShortName).build()); this->addOption(storm::settings::OptionBuilder(moduleName, propProbabilityOptionName, false, "Compute probability of system failure.").build()); this->addOption(storm::settings::OptionBuilder(moduleName, propTimeBoundOptionName, false, "Compute probability of system failure up to given timebound.").addArgument(storm::settings::ArgumentBuilder::createDoubleArgument("time", "The timebound to use.").addValidationFunctionDouble(storm::settings::ArgumentValidators::doubleGreaterValidatorExcluding(0.0)).build()).build()); @@ -67,6 +70,10 @@ namespace storm { return this->getOption(disableDCOptionName).getHasOptionBeenSet(); } + bool DFTSettings::computeApproximation() const { + return this->getOption(computeApproximationOptionName).getHasOptionBeenSet(); + } + bool DFTSettings::usePropExpectedTime() const { return this->getOption(propExpectedTimeOptionName).getHasOptionBeenSet(); } @@ -116,4 +123,4 @@ namespace storm { } // namespace modules } // namespace settings -} // namespace storm \ No newline at end of file +} // namespace storm diff --git a/src/settings/modules/DFTSettings.h b/src/settings/modules/DFTSettings.h index 183e00eef..f21752f7f 100644 --- a/src/settings/modules/DFTSettings.h +++ b/src/settings/modules/DFTSettings.h @@ -57,6 +57,13 @@ namespace storm { */ bool isDisableDC() const; + /*! + * Retrieves whether the option to compute an approximation is set. + * + * @return True iff the option was set. + */ + bool computeApproximation() const; + /*! * Retrieves whether the property expected time should be used. * @@ -122,6 +129,8 @@ namespace storm { static const std::string symmetryReductionOptionShortName; static const std::string modularisationOptionName; static const std::string disableDCOptionName; + static const std::string computeApproximationOptionName; + static const std::string computeApproximationOptionShortName; static const std::string propExpectedTimeOptionName; static const std::string propExpectedTimeOptionShortName; static const std::string propProbabilityOptionName;