type FunctionShape … type FunctionShapePoint … // BuildBrokenLinearFunction creates a function which is built using linear segments. Segments are defined via shape array. // Shape[i].Utilization slice represents points on "Utilization" axis where different segments meet. // Shape[i].Score represents function values at meeting points. // // function f(p) is defined as: // // shape[0].Score for p < shape[0].Utilization // shape[n-1].Score for p > shape[n-1].Utilization // // and linear between points (p < shape[i].Utilization) func BuildBrokenLinearFunction(shape FunctionShape) func(int64) int64 { … }