9 changed files with 184 additions and 9 deletions
			
			
		- 
					4src/storm/environment/SubEnvironment.cpp
- 
					33src/storm/environment/solver/OviSolverEnvironment.cpp
- 
					25src/storm/environment/solver/OviSolverEnvironment.h
- 
					9src/storm/environment/solver/SolverEnvironment.cpp
- 
					4src/storm/environment/solver/SolverEnvironment.h
- 
					2src/storm/settings/SettingsManager.cpp
- 
					42src/storm/settings/modules/OviSolverSettings.cpp
- 
					36src/storm/settings/modules/OviSolverSettings.h
- 
					38src/storm/solver/IterativeMinMaxLinearEquationSolver.cpp
| @ -0,0 +1,33 @@ | |||
| #include "storm/environment/solver/OviSolverEnvironment.h"
 | |||
| 
 | |||
| #include "storm/settings/SettingsManager.h"
 | |||
| #include "storm/settings/modules/OviSolverSettings.h"
 | |||
| #include "storm/utility/constants.h"
 | |||
| #include "storm/utility/macros.h"
 | |||
| 
 | |||
| namespace storm { | |||
|      | |||
|     OviSolverEnvironment::OviSolverEnvironment() { | |||
|         auto const& oviSettings = storm::settings::getModule<storm::settings::modules::OviSolverSettings>(); | |||
|         precisionUpdateFactor = storm::utility::convertNumber<storm::RationalNumber>(oviSettings.getPrecisionUpdateFactor()); | |||
|         maxVerificationIterationFactor = storm::utility::convertNumber<storm::RationalNumber>(oviSettings.getMaxVerificationIterationFactor()); | |||
|         relevantValuesForPrecisionUpdate = oviSettings.useRelevantValuesForPrecisionUpdate(); | |||
|     }; | |||
|      | |||
|     OviSolverEnvironment::~OviSolverEnvironment() { | |||
|         // Intentionally left empty
 | |||
|     } | |||
|      | |||
|     storm::RationalNumber OviSolverEnvironment::getPrecisionUpdateFactor() const { | |||
|         return precisionUpdateFactor; | |||
|     } | |||
|      | |||
|     storm::RationalNumber OviSolverEnvironment::getMaxVerificationIterationFactor() const { | |||
|         return maxVerificationIterationFactor; | |||
|     } | |||
|      | |||
|     bool OviSolverEnvironment::useRelevantValuesForPrecisionUpdate() const { | |||
|         return relevantValuesForPrecisionUpdate; | |||
|     } | |||
|      | |||
| } | |||
| @ -0,0 +1,25 @@ | |||
| #pragma once | |||
| 
 | |||
| #include "storm/environment/solver/SolverEnvironment.h" | |||
| 
 | |||
| #include "storm/adapters/RationalNumberAdapter.h" | |||
| 
 | |||
| namespace storm { | |||
|      | |||
|     class OviSolverEnvironment { | |||
|     public: | |||
|          | |||
|         OviSolverEnvironment(); | |||
|         ~OviSolverEnvironment(); | |||
|          | |||
|         storm::RationalNumber getPrecisionUpdateFactor() const; | |||
|         storm::RationalNumber getMaxVerificationIterationFactor() const; | |||
|         bool useRelevantValuesForPrecisionUpdate() const; | |||
|          | |||
|     private: | |||
|         storm::RationalNumber precisionUpdateFactor; | |||
|         storm::RationalNumber maxVerificationIterationFactor; | |||
|         bool relevantValuesForPrecisionUpdate; | |||
|     }; | |||
| } | |||
| 
 | |||
| @ -0,0 +1,42 @@ | |||
| #include "storm/settings/modules/OviSolverSettings.h"
 | |||
| 
 | |||
| #include "storm/settings/Option.h"
 | |||
| #include "storm/settings/ArgumentBuilder.h"
 | |||
| #include "storm/settings/OptionBuilder.h"
 | |||
| 
 | |||
| #include "storm/utility/macros.h"
 | |||
| #include "storm/exceptions/IllegalArgumentValueException.h"
 | |||
| 
 | |||
| namespace storm { | |||
|     namespace settings { | |||
|         namespace modules { | |||
|              | |||
|             const std::string OviSolverSettings::moduleName = "ovi"; | |||
|             const std::string OviSolverSettings::precisionUpdateFactorOptionName = "precision-update-factor"; | |||
|             const std::string OviSolverSettings::maxVerificationIterationFactorOptionName = "max-verification-iter-factor"; | |||
|             const std::string OviSolverSettings::useRelevantValuesForPrecisionUpdateOptionName = "use-relevant-values"; | |||
|              | |||
|             OviSolverSettings::OviSolverSettings() : ModuleSettings(moduleName) { | |||
|                  | |||
|                 this->addOption(storm::settings::OptionBuilder(moduleName, precisionUpdateFactorOptionName, false, "Sets with which factor the precision of the inner value iteration is updated.").setIsAdvanced().addArgument(storm::settings::ArgumentBuilder::createDoubleArgument("factor", "The factor.").setDefaultValueDouble(0.5).addValidatorDouble(ArgumentValidatorFactory::createDoubleRangeValidatorExcluding(0.0, 1.0)).build()).build()); | |||
|                  | |||
|                 this->addOption(storm::settings::OptionBuilder(moduleName, useRelevantValuesForPrecisionUpdateOptionName, false, "Sets whether the precision of the inner value iteration is only based on the relevant values (i.e. initial states).").setIsAdvanced().build()); | |||
|                  | |||
|                 this->addOption(storm::settings::OptionBuilder(moduleName, maxVerificationIterationFactorOptionName, false, "Controls how many verification iterations are performed before guessing a new upper bound.").setIsAdvanced().addArgument(storm::settings::ArgumentBuilder::createDoubleArgument("factor", "The factor.").setDefaultValueDouble(0.1).addValidatorDouble(ArgumentValidatorFactory::createDoubleGreaterValidator(0.0)).build()).build()); | |||
|             } | |||
|              | |||
|             double OviSolverSettings::getPrecisionUpdateFactor() const { | |||
|                 return this->getOption(precisionUpdateFactorOptionName).getArgumentByName("factor").getValueAsDouble(); | |||
|             } | |||
|              | |||
|             double OviSolverSettings::getMaxVerificationIterationFactor() const { | |||
|                 return this->getOption(maxVerificationIterationFactorOptionName).getArgumentByName("factor").getValueAsDouble(); | |||
|             } | |||
|              | |||
|             bool OviSolverSettings::useRelevantValuesForPrecisionUpdate() const { | |||
|                 return this->getOption(useRelevantValuesForPrecisionUpdateOptionName).getHasOptionBeenSet(); | |||
|             } | |||
|             | |||
|         } | |||
|     } | |||
| } | |||
| @ -0,0 +1,36 @@ | |||
| #pragma once | |||
| 
 | |||
| #include "storm-config.h" | |||
| #include "storm/settings/modules/ModuleSettings.h" | |||
| 
 | |||
| namespace storm { | |||
|     namespace settings { | |||
|         namespace modules { | |||
|              | |||
|             /*! | |||
|              * This class represents the settings for the optimistic value iteration solver. | |||
|              */ | |||
|             class OviSolverSettings : public ModuleSettings { | |||
|             public: | |||
|                  | |||
|                 OviSolverSettings(); | |||
|                | |||
|                 double getPrecisionUpdateFactor() const; | |||
|                  | |||
|                 double getMaxVerificationIterationFactor() const; | |||
|                  | |||
|                 bool useRelevantValuesForPrecisionUpdate() const; | |||
|                  | |||
|                  | |||
|                 // The name of the module. | |||
|                 static const std::string moduleName; | |||
|                  | |||
|             private: | |||
|                 static const std::string precisionUpdateFactorOptionName; | |||
|                 static const std::string maxVerificationIterationFactorOptionName; | |||
|                 static const std::string useRelevantValuesForPrecisionUpdateOptionName; | |||
|             }; | |||
|              | |||
|         } | |||
|     } | |||
| } | |||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue