Matthias Volk
7 years ago
7 changed files with 232 additions and 116 deletions
-
172src/storm-dft-cli/storm-dft.cpp
-
11src/storm-dft/api/storm-dft.cpp
-
2src/storm-dft/settings/DftSettings.cpp
-
52src/storm-dft/settings/modules/DftGspnSettings.cpp
-
58src/storm-dft/settings/modules/DftGspnSettings.h
-
45src/storm-dft/settings/modules/DftIOSettings.cpp
-
8src/storm-dft/settings/modules/DftIOSettings.h
@ -0,0 +1,52 @@ |
|||
#include "DftGspnSettings.h"
|
|||
|
|||
#include "storm/settings/SettingsManager.h"
|
|||
#include "storm/settings/SettingMemento.h"
|
|||
#include "storm/settings/Option.h"
|
|||
#include "storm/settings/OptionBuilder.h"
|
|||
#include "storm/settings/ArgumentBuilder.h"
|
|||
#include "storm/settings/Argument.h"
|
|||
#include "storm/exceptions/InvalidSettingsException.h"
|
|||
|
|||
namespace storm { |
|||
namespace settings { |
|||
namespace modules { |
|||
|
|||
const std::string DftGspnSettings::moduleName = "dftGspn"; |
|||
const std::string DftGspnSettings::transformToGspnOptionName = "to-gspn"; |
|||
const std::string DftGspnSettings::disableSmartTransformationOptionName = "disable-smart"; |
|||
const std::string DftGspnSettings::mergeDCFailedOptionName = "merge-dc-failed"; |
|||
|
|||
|
|||
DftGspnSettings::DftGspnSettings() : ModuleSettings(moduleName) { |
|||
this->addOption(storm::settings::OptionBuilder(moduleName, transformToGspnOptionName, false, "Transform DFT to GSPN.").build()); |
|||
this->addOption(storm::settings::OptionBuilder(moduleName, disableSmartTransformationOptionName, false, "Disable smart transformation.").build()); |
|||
this->addOption(storm::settings::OptionBuilder(moduleName, mergeDCFailedOptionName, false, "Enable merging of Don't Care and Failed places into a combined place.").build()); |
|||
} |
|||
|
|||
bool DftGspnSettings::isTransformToGspn() const { |
|||
return this->getOption(transformToGspnOptionName).getHasOptionBeenSet(); |
|||
} |
|||
|
|||
bool DftGspnSettings::isDisableSmartTransformation() const { |
|||
return this->getOption(disableSmartTransformationOptionName).getHasOptionBeenSet(); |
|||
} |
|||
|
|||
bool DftGspnSettings::isMergeDCFailed() const { |
|||
return this->getOption(mergeDCFailedOptionName).getHasOptionBeenSet(); |
|||
} |
|||
|
|||
void DftGspnSettings::finalize() { |
|||
} |
|||
|
|||
bool DftGspnSettings::check() const { |
|||
// Ensure that GSPN option is set if other options are set.
|
|||
STORM_LOG_THROW(isTransformToGspn() || (!isDisableSmartTransformation() && !isMergeDCFailed()), storm::exceptions::InvalidSettingsException, |
|||
"GSPN transformation should be enabled when giving options for the transformation."); |
|||
return true; |
|||
} |
|||
|
|||
} // namespace modules
|
|||
} // namespace settings
|
|||
} // namespace storm
|
|||
|
@ -0,0 +1,58 @@ |
|||
#pragma once |
|||
|
|||
#include "storm/settings/modules/ModuleSettings.h" |
|||
|
|||
namespace storm { |
|||
namespace settings { |
|||
namespace modules { |
|||
|
|||
/*! |
|||
* This class represents the settings for operations concerning the DFT to GSPN transformation. |
|||
*/ |
|||
class DftGspnSettings : public ModuleSettings { |
|||
public: |
|||
|
|||
/*! |
|||
* Creates a new set of DFT-GSPN settings. |
|||
*/ |
|||
DftGspnSettings(); |
|||
|
|||
/*! |
|||
* Retrieves whether the DFT should be transformed into a GSPN. |
|||
* |
|||
* @return True iff the option was set. |
|||
*/ |
|||
bool isTransformToGspn() const; |
|||
|
|||
/*! |
|||
* Retrieves whether the smart transformation should be disabled. |
|||
* |
|||
* @return True if the smart transformation should be disabled. |
|||
*/ |
|||
bool isDisableSmartTransformation() const; |
|||
|
|||
/*! |
|||
* Retrieves whether the DC and failed place should be merged. |
|||
* |
|||
* @return True if the merge of DC and failed place is enabled. |
|||
*/ |
|||
bool isMergeDCFailed() const; |
|||
|
|||
bool check() const override; |
|||
|
|||
void finalize() override; |
|||
|
|||
// The name of the module. |
|||
static const std::string moduleName; |
|||
|
|||
private: |
|||
// Define the string names of the options as constants. |
|||
static const std::string transformToGspnOptionName; |
|||
static const std::string disableSmartTransformationOptionName; |
|||
static const std::string mergeDCFailedOptionName; |
|||
|
|||
}; |
|||
|
|||
} // namespace modules |
|||
} // namespace settings |
|||
} // namespace storm |
Write
Preview
Loading…
Cancel
Save
Reference in new issue