Browse Source

Added possibility to avoid non-determinism by only taking the first dependency

tempestpy_adaptions
Matthias Volk 8 years ago
parent
commit
40212bb7e6
  1. 6
      src/storm-dft/generator/DftNextStateGenerator.cpp
  2. 6
      src/storm-dft/settings/modules/DFTSettings.cpp
  3. 8
      src/storm-dft/settings/modules/DFTSettings.h

6
src/storm-dft/generator/DftNextStateGenerator.cpp

@ -3,6 +3,8 @@
#include "storm/utility/constants.h"
#include "storm/utility/macros.h"
#include "storm/exceptions/NotImplementedException.h"
#include "storm/settings/SettingsManager.h"
#include "storm-dft/settings/modules/DFTSettings.h"
namespace storm {
namespace generator {
@ -69,6 +71,10 @@ namespace storm {
// Let BE fail
while (currentFailable < failableCount) {
if (storm::settings::getModule<storm::settings::modules::DFTSettings>().isTakeFirstDependency() && hasDependencies && currentFailable > 0) {
// We discard further exploration as we already chose one dependent event
break;
}
STORM_LOG_ASSERT(!mDft.hasFailed(state), "Dft has failed.");
// Construct new state as copy from original one

6
src/storm-dft/settings/modules/DFTSettings.cpp

@ -33,6 +33,7 @@ namespace storm {
const std::string DFTSettings::propTimepointsOptionName = "timepoints";
const std::string DFTSettings::minValueOptionName = "min";
const std::string DFTSettings::maxValueOptionName = "max";
const std::string DFTSettings::firstDependencyOptionName = "firstdep";
const std::string DFTSettings::transformToGspnOptionName = "gspn";
const std::string DFTSettings::exportToJsonOptionName = "export-json";
#ifdef STORM_HAVE_Z3
@ -47,6 +48,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, firstDependencyOptionName, false, "Avoid non-determinism by always taking the first possible dependency.").build());
this->addOption(storm::settings::OptionBuilder(moduleName, approximationErrorOptionName, false, "Approximation error allowed.").setShortName(approximationErrorOptionShortName).addArgument(storm::settings::ArgumentBuilder::createDoubleArgument("error", "The relative approximation error to use.").addValidatorDouble(ArgumentValidatorFactory::createDoubleGreaterEqualValidator(0.0)).build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName, approximationHeuristicOptionName, false, "Set the heuristic used for approximation.").addArgument(storm::settings::ArgumentBuilder::createStringArgument("heuristic", "Sets which heuristic is used for approximation. Must be in {depth, probability}. Default is").setDefaultValueString("depth").addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator({"depth", "rateratio"})).build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName, propExpectedTimeOptionName, false, "Compute expected time of system failure.").setShortName(propExpectedTimeOptionShortName).build());
@ -151,6 +153,10 @@ namespace storm {
return this->getOption(maxValueOptionName).getHasOptionBeenSet();
}
bool DFTSettings::isTakeFirstDependency() const {
return this->getOption(firstDependencyOptionName).getHasOptionBeenSet();
}
#ifdef STORM_HAVE_Z3
bool DFTSettings::solveWithSMT() const {
return this->getOption(solveWithSmtOptionName).getHasOptionBeenSet();

8
src/storm-dft/settings/modules/DFTSettings.h

@ -146,6 +146,13 @@ namespace storm {
*/
bool isComputeMaximalValue() const;
/*!
* Retrieves whether the non-determinism should be avoided by always taking the first possible dependency.
*
* @return True iff the option was set.
*/
bool isTakeFirstDependency() const;
/*!
* Retrieves whether the DFT should be transformed into a GSPN.
*
@ -202,6 +209,7 @@ namespace storm {
static const std::string propTimepointsOptionName;
static const std::string minValueOptionName;
static const std::string maxValueOptionName;
static const std::string firstDependencyOptionName;
#ifdef STORM_HAVE_Z3
static const std::string solveWithSmtOptionName;
#endif

Loading…
Cancel
Save