From 661d922d2e68aaf720173862e4ee79741a252fee Mon Sep 17 00:00:00 2001 From: Tim Quatmann Date: Tue, 29 Jan 2019 12:56:29 +0100 Subject: [PATCH] logic/bound: Added method to compare a bound with a value. --- src/storm/logic/Bound.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/storm/logic/Bound.h b/src/storm/logic/Bound.h index 21f2c7282..a39edb5dc 100644 --- a/src/storm/logic/Bound.h +++ b/src/storm/logic/Bound.h @@ -16,6 +16,21 @@ namespace storm { ComparisonType comparisonType; storm::expressions::Expression threshold; + template + bool isSatisfied(ValueType const& compareValue) { + ValueType thresholdAsValueType = storm::utility::convertNumber(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); };