diff --git a/src/storm-pomdp-cli/settings/modules/POMDPSettings.cpp b/src/storm-pomdp-cli/settings/modules/POMDPSettings.cpp index 57c065f7a..09a5342b3 100644 --- a/src/storm-pomdp-cli/settings/modules/POMDPSettings.cpp +++ b/src/storm-pomdp-cli/settings/modules/POMDPSettings.cpp @@ -15,7 +15,8 @@ namespace storm { const std::string POMDPSettings::moduleName = "pomdp"; const std::string noCanonicOption = "nocanonic"; const std::string exportAsParametricModelOption = "parametric-drn"; - const std::string gridApproximationOption = "gridapproximation"; + const std::string beliefExplorationOption = "belief-exploration"; + std::vector beliefExplorationModes = {"both", "discretize", "unfold"}; const std::string qualitativeReductionOption = "qualitativereduction"; const std::string analyzeUniqueObservationsOption = "uniqueobservations"; const std::string mecReductionOption = "mecreduction"; @@ -43,7 +44,7 @@ namespace storm { 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()); - this->addOption(storm::settings::OptionBuilder(moduleName, gridApproximationOption, false,"Analyze the POMDP using grid approximation.").build()); + this->addOption(storm::settings::OptionBuilder(moduleName, beliefExplorationOption, false,"Analyze the POMDP by exploring the belief state-space.").addArgument(storm::settings::ArgumentBuilder::createStringArgument("mode", "Sets whether lower, upper, or interval result bounds are computed.").addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(beliefExplorationModes)).setDefaultValueString("both").makeOptional().build()).build()); this->addOption(storm::settings::OptionBuilder(moduleName, memlessSearchOption, false, "Search for a qualitative memoryless scheuler").addArgument(storm::settings::ArgumentBuilder::createStringArgument("method", "method name").addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(memlessSearchMethods)).setDefaultValueString("none").build()).build()); this->addOption(storm::settings::OptionBuilder(moduleName, checkFullyObservableOption, false, "Performs standard model checking on the underlying MDP").build()); @@ -77,8 +78,18 @@ namespace storm { return this->getOption(selfloopReductionOption).getHasOptionBeenSet(); } - bool POMDPSettings::isGridApproximationSet() const { - return this->getOption(gridApproximationOption).getHasOptionBeenSet(); + bool POMDPSettings::isBeliefExplorationSet() const { + return this->getOption(beliefExplorationOption).getHasOptionBeenSet(); + } + + bool POMDPSettings::isBeliefExplorationDiscretizeSet() const { + std::string arg = this->getOption(beliefExplorationOption).getArgumentByName("mode").getValueAsString(); + return isBeliefExplorationSet() && (arg == "discretize" || arg == "both"); + } + + bool POMDPSettings::isBeliefExplorationUnfoldSet() const { + std::string arg = this->getOption(beliefExplorationOption).getArgumentByName("mode").getValueAsString(); + return isBeliefExplorationSet() && (arg == "unfold" || arg == "both"); } bool POMDPSettings::isMemlessSearchSet() const { diff --git a/src/storm-pomdp-cli/settings/modules/POMDPSettings.h b/src/storm-pomdp-cli/settings/modules/POMDPSettings.h index 6754ac55c..d1a9e6b82 100644 --- a/src/storm-pomdp-cli/settings/modules/POMDPSettings.h +++ b/src/storm-pomdp-cli/settings/modules/POMDPSettings.h @@ -27,7 +27,9 @@ namespace storm { bool isQualitativeReductionSet() const; bool isNoCanonicSet() const; - bool isGridApproximationSet() const; + bool isBeliefExplorationSet() const; + bool isBeliefExplorationDiscretizeSet() const; + bool isBeliefExplorationUnfoldSet() const; bool isAnalyzeUniqueObservationsSet() const; bool isMecReductionSet() const; bool isSelfloopReductionSet() const; diff --git a/src/storm-pomdp-cli/storm-pomdp.cpp b/src/storm-pomdp-cli/storm-pomdp.cpp index a6da25b16..ebfa22e7c 100644 --- a/src/storm-pomdp-cli/storm-pomdp.cpp +++ b/src/storm-pomdp-cli/storm-pomdp.cpp @@ -99,16 +99,16 @@ namespace storm { bool performAnalysis(std::shared_ptr> const& pomdp, storm::pomdp::analysis::FormulaInformation const& formulaInfo, storm::logic::Formula const& formula) { auto const& pomdpSettings = storm::settings::getModule(); bool analysisPerformed = false; - if (pomdpSettings.isGridApproximationSet()) { - STORM_PRINT_AND_LOG("Applying grid approximation... "); + if (pomdpSettings.isBeliefExplorationSet()) { + STORM_PRINT_AND_LOG("Exploring the belief MDP... "); auto const& gridSettings = storm::settings::getModule(); typename storm::pomdp::modelchecker::ApproximatePOMDPModelchecker>::Options options; std::cout << "TODO: create and read from new settings!" << std::endl; // options.initialGridResolution = gridSettings.getGridResolution(); // options.explorationThreshold = storm::utility::convertNumber(gridSettings.getExplorationThreshold()); options.refine = gridSettings.isRefineSet(); - options.unfold = true; - options.discretize = true; + options.unfold = pomdpSettings.isBeliefExplorationUnfoldSet(); + options.discretize = pomdpSettings.isBeliefExplorationDiscretizeSet(); // options.refinementPrecision = storm::utility::convertNumber(gridSettings.getRefinementPrecision()); // options.numericPrecision = storm::utility::convertNumber(gridSettings.getNumericPrecision()); // options.cacheSubsimplices = gridSettings.isCacheSimplicesSet();