Browse Source

logic/bound: Added method to compare a bound with a value.

tempestpy_adaptions
Tim Quatmann 6 years ago
parent
commit
661d922d2e
  1. 15
      src/storm/logic/Bound.h

15
src/storm/logic/Bound.h

@ -16,6 +16,21 @@ namespace storm {
ComparisonType comparisonType;
storm::expressions::Expression threshold;
template <typename ValueType>
bool isSatisfied(ValueType const& compareValue) {
ValueType thresholdAsValueType = storm::utility::convertNumber<ValueType>(threshold.evaluateAsRational());
switch(comparisonType) {
case ComparisonType::Greater:
return compareValue > thresholdAsValueType;
case ComparisonType::GreaterEqual:
return compareValue >= thresholdAsValueType;
case ComparisonType::Less:
return compareValue < thresholdAsValueType;
case ComparisonType::LessEqual:
return compareValue <= thresholdAsValueType;
}
}
friend std::ostream& operator<<(std::ostream& out, Bound const& bound);
};

Loading…
Cancel
Save