6 changed files with 119 additions and 38 deletions
-
2src/storm-pomdp-cli/settings/PomdpSettings.cpp
-
24src/storm-pomdp-cli/settings/modules/POMDPSettings.cpp
-
4src/storm-pomdp-cli/settings/modules/POMDPSettings.h
-
56src/storm-pomdp-cli/settings/modules/ToParametricSettings.cpp
-
49src/storm-pomdp-cli/settings/modules/ToParametricSettings.h
-
22src/storm-pomdp-cli/storm-pomdp.cpp
@ -0,0 +1,56 @@ |
|||||
|
#include "storm-pomdp-cli/settings/modules/ToParametricSettings.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/exceptions/InvalidArgumentException.h"
|
||||
|
|
||||
|
namespace storm { |
||||
|
namespace settings { |
||||
|
namespace modules { |
||||
|
|
||||
|
const std::string ToParametricSettings::moduleName = "toparametric"; |
||||
|
const std::string mecReductionOption = "mecreduction"; |
||||
|
const std::string selfloopReductionOption = "selfloopreduction"; |
||||
|
const std::string fscmode = "fscmode"; |
||||
|
std::vector<std::string> fscModes = {"standard", "simple-linear", "simple-linear-inverse"}; |
||||
|
const std::string transformBinaryOption = "transformbinary"; |
||||
|
const std::string transformSimpleOption = "transformsimple"; |
||||
|
|
||||
|
ToParametricSettings::ToParametricSettings() : ModuleSettings(moduleName) { |
||||
|
this->addOption(storm::settings::OptionBuilder(moduleName, mecReductionOption, false, "Reduces the model size by analyzing maximal end components").build()); |
||||
|
this->addOption(storm::settings::OptionBuilder(moduleName, fscmode, false, "Sets the way the pMC is obtained").addArgument(storm::settings::ArgumentBuilder::createStringArgument("type", "type name").addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(fscModes)).setDefaultValueString("standard").build()).build()); |
||||
|
this->addOption(storm::settings::OptionBuilder(moduleName, transformBinaryOption, false, "Transforms the pomdp to a binary pomdp.").build()); |
||||
|
this->addOption(storm::settings::OptionBuilder(moduleName, transformSimpleOption, false, "Transforms the pomdp to a binary and simple pomdp.").build()); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
bool ToParametricSettings::isMecReductionSet() const { |
||||
|
return this->getOption(mecReductionOption).getHasOptionBeenSet(); |
||||
|
} |
||||
|
|
||||
|
std::string ToParametricSettings::getFscApplicationTypeString() const { |
||||
|
return this->getOption(fscmode).getArgumentByName("type").getValueAsString(); |
||||
|
} |
||||
|
|
||||
|
bool ToParametricSettings::isTransformBinarySet() const { |
||||
|
return this->getOption(transformBinaryOption).getHasOptionBeenSet(); |
||||
|
} |
||||
|
|
||||
|
bool ToParametricSettings::isTransformSimpleSet() const { |
||||
|
return this->getOption(transformSimpleOption).getHasOptionBeenSet(); |
||||
|
} |
||||
|
|
||||
|
void ToParametricSettings::finalize() { |
||||
|
} |
||||
|
|
||||
|
bool ToParametricSettings::check() const { |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
} // namespace modules
|
||||
|
} // namespace settings
|
||||
|
} // namespace storm
|
@ -0,0 +1,49 @@ |
|||||
|
#pragma once |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include "storm-config.h" |
||||
|
#include "storm/settings/modules/ModuleSettings.h" |
||||
|
#include "storm-pomdp/storage/PomdpMemory.h" |
||||
|
|
||||
|
namespace storm { |
||||
|
namespace settings { |
||||
|
namespace modules { |
||||
|
|
||||
|
/*! |
||||
|
* This class represents the settings for POMDP model checking. |
||||
|
*/ |
||||
|
class ToParametricSettings : public ModuleSettings { |
||||
|
public: |
||||
|
|
||||
|
/*! |
||||
|
* Creates a new set of POMDP settings. |
||||
|
*/ |
||||
|
ToParametricSettings(); |
||||
|
|
||||
|
virtual ~ToParametricSettings() = default; |
||||
|
|
||||
|
bool isExportToParametricSet() const; |
||||
|
std::string getExportToParametricFilename() const; |
||||
|
|
||||
|
bool isQualitativeReductionSet() const; |
||||
|
|
||||
|
bool isMecReductionSet() const; |
||||
|
bool isTransformSimpleSet() const; |
||||
|
bool isTransformBinarySet() const; |
||||
|
std::string getFscApplicationTypeString() const; |
||||
|
|
||||
|
bool check() const override; |
||||
|
void finalize() override; |
||||
|
|
||||
|
// The name of the module. |
||||
|
static const std::string moduleName; |
||||
|
|
||||
|
private: |
||||
|
|
||||
|
|
||||
|
}; |
||||
|
|
||||
|
} // namespace modules |
||||
|
} // namespace settings |
||||
|
} // namespace storm |
Write
Preview
Loading…
Cancel
Save
Reference in new issue