diff --git a/src/modelchecker/CheckSettings.cpp b/src/modelchecker/CheckSettings.cpp index e22db9f2d..74913b076 100644 --- a/src/modelchecker/CheckSettings.cpp +++ b/src/modelchecker/CheckSettings.cpp @@ -8,12 +8,12 @@ namespace storm { namespace modelchecker { template - CheckSettings::CheckSettings() : CheckSettings(boost::none, false, boost::none, false, false) { + CheckSettings::CheckSettings() : CheckSettings(boost::none, boost::none, false, boost::none, false, false) { // Intentionally left empty. } template - CheckSettings::CheckSettings(boost::optional const& optimizationDirection, bool onlyInitialStatesRelevant, boost::optional> const& initialStatesBound, bool qualitative, bool produceStrategies) : optimizationDirection(optimizationDirection), onlyInitialStatesRelevant(onlyInitialStatesRelevant), initialStatesBound(initialStatesBound), qualitative(qualitative), produceStrategies(produceStrategies) { + CheckSettings::CheckSettings(boost::optional const& optimizationDirection, boost::optional const& rewardModel, bool onlyInitialStatesRelevant, boost::optional> const& initialStatesBound, bool qualitative, bool produceStrategies) : optimizationDirection(optimizationDirection), rewardModel(rewardModel), onlyInitialStatesRelevant(onlyInitialStatesRelevant), initialStatesBound(initialStatesBound), qualitative(qualitative), produceStrategies(produceStrategies) { // Intentionally left empty. } @@ -30,6 +30,7 @@ namespace storm { template CheckSettings CheckSettings::fromFormula(storm::logic::Formula const& formula, bool toplevel) { boost::optional optimizationDirection; + boost::optional rewardModel; boost::optional> initialStatesBound; bool qualitative = false; bool onlyInitialStatesRelevant = !toplevel; @@ -51,6 +52,8 @@ namespace storm { } } else if (formula.isRewardOperatorFormula()) { storm::logic::RewardOperatorFormula const& rewardOperatorFormula = formula.asRewardOperatorFormula(); + rewardModel = rewardOperatorFormula.getOptionalRewardModelName(); + if (rewardOperatorFormula.hasOptimalityType()) { optimizationDirection = rewardOperatorFormula.getOptimalityType(); } @@ -64,7 +67,7 @@ namespace storm { } } } - return CheckSettings(optimizationDirection, onlyInitialStatesRelevant, initialStatesBound, qualitative, produceStrategies); + return CheckSettings(optimizationDirection, rewardModel, onlyInitialStatesRelevant, initialStatesBound, qualitative, produceStrategies); } template @@ -77,6 +80,16 @@ namespace storm { return optimizationDirection.get(); } + template + bool CheckSettings::isRewardModelSet() const { + return static_cast(rewardModel); + } + + template + std::string const& CheckSettings::getRewardModel() const { + return rewardModel.get(); + } + template bool CheckSettings::isOnlyInitialStatesRelevantSet() const { return onlyInitialStatesRelevant; diff --git a/src/modelchecker/CheckSettings.h b/src/modelchecker/CheckSettings.h index 5a4826aef..2703cc119 100644 --- a/src/modelchecker/CheckSettings.h +++ b/src/modelchecker/CheckSettings.h @@ -48,6 +48,16 @@ namespace storm { */ storm::OptimizationDirection const& getOptimizationDirection() const; + /*! + * Retrieves whether a reward model was set. + */ + bool isRewardModelSet() const; + + /*! + * Retrieves the reward model over which to perform the checking (if set). + */ + std::string const& getRewardModel() const; + /*! * Retrieves whether only the initial states are relevant in the computation. */ @@ -79,6 +89,7 @@ namespace storm { * Creates a settings object with the given options. * * @param optimizationDirection If set, the probabilities will be minimized/maximized. + * @param rewardModelName If given, the checking has to be done wrt. to this reward model. * @param onlyInitialStatesRelevant If set to true, the model checker may decide to only compute the values * for the initial states. * @param initialStatesBound The bound with which the initial states will be compared. This may only be set @@ -88,7 +99,7 @@ namespace storm { * @param produceStrategies If supported by the model checker and the model formalism, strategies to achieve * a value will be produced if this flag is set. */ - CheckSettings(boost::optional const& optimizationDirection, bool onlyInitialStatesRelevant, boost::optional> const& initialStatesBound, bool qualitative, bool produceStrategies); + CheckSettings(boost::optional const& optimizationDirection, boost::optional const& rewardModel, bool onlyInitialStatesRelevant, boost::optional> const& initialStatesBound, bool qualitative, bool produceStrategies); /*! * Creates a settings object for the given formula. @@ -101,6 +112,9 @@ namespace storm { // If set, the probabilities will be minimized/maximized. boost::optional optimizationDirection; + // If set, the reward property has to be interpreted over this model. + boost::optional rewardModel; + // If set to true, the model checker may decide to only compute the values for the initial states. bool onlyInitialStatesRelevant;