Browse Source

new argument validator: doubleRangeValidatorIncluding

tempestpy_adaptions
TimQu 7 years ago
parent
commit
6621cb814c
  1. 9
      src/storm/settings/ArgumentValidators.cpp
  2. 5
      src/storm/settings/ArgumentValidators.h

9
src/storm/settings/ArgumentValidators.cpp

@ -133,6 +133,10 @@ namespace storm {
return createRangeValidatorExcluding<double>(lowerBound, upperBound);
}
std::shared_ptr<ArgumentValidator<double>> ArgumentValidatorFactory::createDoubleRangeValidatorIncluding(double lowerBound, double upperBound) {
return createRangeValidatorIncluding<double>(lowerBound, upperBound);
}
std::shared_ptr<ArgumentValidator<int64_t>> ArgumentValidatorFactory::createIntegerGreaterValidator(int_fast64_t lowerBound) {
return createGreaterValidator<int64_t>(lowerBound, false);
}
@ -174,6 +178,11 @@ namespace storm {
return std::make_unique<RangeArgumentValidator<ValueType>>(lowerBound, upperBound, false, false);
}
template <typename ValueType>
std::shared_ptr<ArgumentValidator<ValueType>> ArgumentValidatorFactory::createRangeValidatorIncluding(ValueType lowerBound, ValueType upperBound) {
return std::make_unique<RangeArgumentValidator<ValueType>>(lowerBound, upperBound, true, true);
}
template <typename ValueType>
std::shared_ptr<ArgumentValidator<ValueType>> ArgumentValidatorFactory::createGreaterValidator(ValueType lowerBound, bool equalAllowed) {
return std::make_unique<RangeArgumentValidator<ValueType>>(lowerBound, boost::none, equalAllowed, false);

5
src/storm/settings/ArgumentValidators.h

@ -70,6 +70,8 @@ namespace storm {
static std::shared_ptr<ArgumentValidator<uint64_t>> createUnsignedRangeValidatorExcluding(uint64_t lowerBound, uint64_t upperBound);
static std::shared_ptr<ArgumentValidator<double>> createDoubleRangeValidatorExcluding(double lowerBound, double upperBound);
static std::shared_ptr<ArgumentValidator<double>> createDoubleRangeValidatorIncluding(double lowerBound, double upperBound);
static std::shared_ptr<ArgumentValidator<int64_t>> createIntegerGreaterValidator(int_fast64_t lowerBound);
static std::shared_ptr<ArgumentValidator<uint64_t>> createUnsignedGreaterValidator(uint64_t lowerBound);
static std::shared_ptr<ArgumentValidator<double>> createDoubleGreaterValidator(double lowerBound);
@ -87,6 +89,9 @@ namespace storm {
template <typename ValueType>
static std::shared_ptr<ArgumentValidator<ValueType>> createRangeValidatorExcluding(ValueType lowerBound, ValueType upperBound);
template <typename ValueType>
static std::shared_ptr<ArgumentValidator<ValueType>> createRangeValidatorIncluding(ValueType lowerBound, ValueType upperBound);
template <typename ValueType>
static std::shared_ptr<ArgumentValidator<ValueType>> createGreaterValidator(ValueType lowerBound, bool equalAllowed);
};

Loading…
Cancel
Save