computeValueMax returns the highest value among all matching labels.
(matchingValues []int, matchedLabels []string)
| 108 | |
| 109 | // computeValueMax returns the highest value among all matching labels. |
| 110 | func (om *ObjectiveMapping) computeValueMax(matchingValues []int, matchedLabels []string) int { |
| 111 | maxVal := matchingValues[0] |
| 112 | for _, v := range matchingValues { |
| 113 | if v > maxVal { |
| 114 | maxVal = v |
| 115 | } |
| 116 | } |
| 117 | labelObjectiveMappingLog.Printf("Computed objective value via max: labels=%v, value=%d", matchedLabels, maxVal) |
| 118 | return maxVal |
| 119 | } |
| 120 | |
| 121 | // DefaultObjectiveMapping returns the built-in default label-to-value mapping. |
| 122 | func DefaultObjectiveMapping() *ObjectiveMapping { |
no test coverage detected