computeConfidence static method

double computeConfidence(
  1. double offRouteDistance
)

E5: Sigmoid Confidence

Implementation

static double computeConfidence(double offRouteDistance) {
  const midpoint = 15.0;
  const steepness = 0.3;
  return 1.0 / (1.0 + math.exp(steepness * (offRouteDistance - midpoint)));
}