From c6b073a08ccd77658cd6ff8a8b0de16a93d11999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Henning?= <soeren.henning@email.uni-kiel.de> Date: Mon, 21 Nov 2022 13:52:48 +0100 Subject: [PATCH] Fix bug introduced with f19a148c0bb7b216e1b27d1956e6c089f0cb5a6a --- .../strategies/restrictionstrategy/LowerBoundRestriction.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/theodolite/src/main/kotlin/rocks/theodolite/core/strategies/restrictionstrategy/LowerBoundRestriction.kt b/theodolite/src/main/kotlin/rocks/theodolite/core/strategies/restrictionstrategy/LowerBoundRestriction.kt index b1c436c32..a1f58b777 100644 --- a/theodolite/src/main/kotlin/rocks/theodolite/core/strategies/restrictionstrategy/LowerBoundRestriction.kt +++ b/theodolite/src/main/kotlin/rocks/theodolite/core/strategies/restrictionstrategy/LowerBoundRestriction.kt @@ -1,6 +1,7 @@ package rocks.theodolite.core.strategies.restrictionstrategy import rocks.theodolite.core.Results +import java.util.* /** * The [LowerBoundRestriction] sets the lower bound of the resources to be examined in the experiment to the value @@ -13,7 +14,8 @@ import rocks.theodolite.core.Results class LowerBoundRestriction(results: Results) : RestrictionStrategy(results) { override fun apply(xValue: Int, yValues: List<Int>): List<Int> { - val maxXValue = this.results.getMaxBenchmarkedXDimensionValue(xValue) + // Get previous largest x value or return full list + val maxXValue = this.results.getMaxBenchmarkedXDimensionValue(xValue) ?: return yValues.toList() // Get previous largest y value or restrict to empty list val lowerBound: Int = this.results.getOptYDimensionValue(maxXValue) ?: return listOf() return yValues.filter { x -> x >= lowerBound } -- GitLab