Browse Source

Merge branch 'master' into deterministicScheds

tempestpy_adaptions
Tim Quatmann 6 years ago
parent
commit
c068b7e387
  1. 5
      src/storm/solver/Z3LpSolver.cpp
  2. 2
      src/storm/storage/geometry/NativePolytope.h
  3. 1
      src/storm/storage/geometry/Polytope.cpp
  4. 26
      src/storm/utility/FilteredRewardModel.h

5
src/storm/solver/Z3LpSolver.cpp

@ -393,6 +393,11 @@ namespace storm {
throw storm::exceptions::NotImplementedException() << "This version of storm was compiled without Z3 or the version of Z3 does not support optimization. Yet, a method was called that requires this support."; throw storm::exceptions::NotImplementedException() << "This version of storm was compiled without Z3 or the version of Z3 does not support optimization. Yet, a method was called that requires this support.";
} }
template<typename ValueType>
void Z3LpSolver<ValueType>::writeModelToFile(std::string const& filename) const {
throw storm::exceptions::NotImplementedException() << "This version of storm was compiled without Z3 or the version of Z3 does not support optimization. Yet, a method was called that requires this support.";
}
template<typename ValueType> template<typename ValueType>
void Z3LpSolver<ValueType>::push() { void Z3LpSolver<ValueType>::push() {
throw storm::exceptions::NotImplementedException() << "This version of storm was compiled without Z3 or the version of Z3 does not support optimization. Yet, a method was called that requires this support."; throw storm::exceptions::NotImplementedException() << "This version of storm was compiled without Z3 or the version of Z3 does not support optimization. Yet, a method was called that requires this support.";

2
src/storm/storage/geometry/NativePolytope.h

@ -1,8 +1,10 @@
#ifndef STORM_STORAGE_GEOMETRY_NATIVEPOLYTOPE_H_ #ifndef STORM_STORAGE_GEOMETRY_NATIVEPOLYTOPE_H_
#define STORM_STORAGE_GEOMETRY_NATIVEPOLYTOPE_H_ #define STORM_STORAGE_GEOMETRY_NATIVEPOLYTOPE_H_
#include <memory>
#include "storm/storage/geometry/Polytope.h" #include "storm/storage/geometry/Polytope.h"
#include "storm/adapters/EigenAdapter.h" #include "storm/adapters/EigenAdapter.h"
#include "storm/storage/expressions/Expression.h"
namespace storm { namespace storm {
namespace storage { namespace storage {

1
src/storm/storage/geometry/Polytope.cpp

@ -66,7 +66,6 @@ namespace storm {
return create(points); return create(points);
} }
assert(points.front().size() == selectedDimensions.size()); assert(points.front().size() == selectedDimensions.size());
uint64_t dimensions = selectedDimensions.size();
std::vector<Halfspace<ValueType>> halfspaces; std::vector<Halfspace<ValueType>> halfspaces;
// We build the convex hull of the given points. // We build the convex hull of the given points.

26
src/storm/utility/FilteredRewardModel.h

@ -8,9 +8,8 @@
namespace storm { namespace storm {
namespace utility { namespace utility {
/* /*
* This class wraps around a
* This class wraps around a Reward model where certain reward types are disabled.
*/ */
template <typename RewardModelType> template <typename RewardModelType>
class FilteredRewardModel { class FilteredRewardModel {
@ -45,20 +44,25 @@ namespace storm {
RewardModelType const* rewardModel; RewardModelType const* rewardModel;
}; };
template <typename ModelType, typename CheckTaskType>
FilteredRewardModel<typename ModelType::RewardModelType> createFilteredRewardModel(ModelType const& model, CheckTaskType const& checkTask) {
auto const& baseRewardModel = checkTask.isRewardModelSet() ? model.getRewardModel(checkTask.getRewardModel()) : model.getUniqueRewardModel();
if (checkTask.getFormula().hasRewardAccumulation()) {
auto const& acc = checkTask.getFormula().getRewardAccumulation();
STORM_LOG_THROW(model.isDiscreteTimeModel() || !acc.isExitSet() || !baseRewardModel.hasStateRewards(), storm::exceptions::NotSupportedException, "Exit rewards for continuous time models are not supported.");
template <typename RewardModelType, typename FormulaType>
FilteredRewardModel<RewardModelType> createFilteredRewardModel(RewardModelType const& baseRewardModel, bool isDiscreteTimeModel, FormulaType const& formula) {
if (formula.hasRewardAccumulation()) {
auto const& acc = formula.getRewardAccumulation();
STORM_LOG_THROW(isDiscreteTimeModel || !acc.isExitSet() || !baseRewardModel.hasStateRewards(), storm::exceptions::NotSupportedException, "Exit rewards for continuous time models are not supported.");
// Check which of the available reward types are allowed. // Check which of the available reward types are allowed.
bool hasStateRewards = model.isDiscreteTimeModel() ? acc.isExitSet() : acc.isTimeSet();
bool hasStateRewards = isDiscreteTimeModel ? acc.isExitSet() : acc.isTimeSet();
bool hasStateActionRewards = acc.isStepsSet(); bool hasStateActionRewards = acc.isStepsSet();
bool hasTransitionRewards = acc.isStepsSet(); bool hasTransitionRewards = acc.isStepsSet();
return FilteredRewardModel<typename ModelType::RewardModelType>(baseRewardModel, hasStateRewards, hasStateActionRewards, hasTransitionRewards);
return FilteredRewardModel<RewardModelType>(baseRewardModel, hasStateRewards, hasStateActionRewards, hasTransitionRewards);
} else { } else {
return FilteredRewardModel<typename ModelType::RewardModelType>(baseRewardModel, true, true, true);
return FilteredRewardModel<RewardModelType>(baseRewardModel, true, true, true);
} }
} }
template <typename ModelType, typename CheckTaskType>
FilteredRewardModel<typename ModelType::RewardModelType> createFilteredRewardModel(ModelType const& model, CheckTaskType const& checkTask) {
auto const& baseRewardModel = checkTask.isRewardModelSet() ? model.getRewardModel(checkTask.getRewardModel()) : model.getUniqueRewardModel();
return createFilteredRewardModel(baseRewardModel, model.isDiscreteTimeModel(), checkTask.getFormula());
}
} }
} }
Loading…
Cancel
Save