changeset 5215:ea60b76d8abd new-fwa

If for given day a bottleneck out of many is not shipable the a stretch/section is no shipable for that day.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 11 May 2020 19:21:40 +0200
parents ebcf33d79d2e
children 91feaf7ac486
files pkg/controllers/fwa.go
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/controllers/fwa.go	Mon May 11 19:12:13 2020 +0200
+++ b/pkg/controllers/fwa.go	Mon May 11 19:21:40 2020 +0200
@@ -305,13 +305,15 @@
 					continue
 				}
 
-				result := bottlenecks[i].measurements.classify(
-					current, next,
-					ldc.value,
-					(*availMeasurement).getValue)
+				if shipable { // if its already not shipable we need no further tests.
+					result := bottlenecks[i].measurements.classify(
+						current, next,
+						ldc.value,
+						(*availMeasurement).getValue)
 
-				if result[1] < 12*time.Hour {
-					shipable = false
+					if result[1] < 12*time.Hour {
+						shipable = false
+					}
 				}
 
 				classes := bottlenecks[i].measurements.classify(