changeset 5217:70d83b7d36ef new-fwa

Track the number days LDCs are not available at bottlenecks.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 11 May 2020 19:52:25 +0200
parents 91feaf7ac486
children 7dbb7cc6dbfa
files pkg/controllers/fwa.go
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/controllers/fwa.go	Mon May 11 19:42:07 2020 +0200
+++ b/pkg/controllers/fwa.go	Mon May 11 19:52:25 2020 +0200
@@ -287,6 +287,7 @@
 	var shipableDays int
 
 	allClasses := make([][]time.Duration, len(validities))
+	missingLDCs := make([]int, len(validities))
 
 	// We step through the time in steps of one day.
 	for current := from; current.Before(to); {
@@ -311,7 +312,7 @@
 			// Let's see if we have a LDC for this day.
 			ldc := vs.ldcs.find(current, next)
 			if ldc == nil {
-				// TODO: log missing LCD
+				missingLDCs[i]++
 				continue
 			}
 
@@ -330,7 +331,6 @@
 				current, next,
 				chooseBreaks[vs.limiting],
 				limitingAccess[vs.limiting])
-
 		}
 
 		if shipable {
@@ -350,6 +350,8 @@
 
 		current = next
 	}
+
+	// TODO: Log missing LDCs
 }
 
 func dusk(t time.Time) time.Time {