ExponentialDeratingFunction implements DeratingFunction { public double getDeratedMultiplier(double distance) { if (distance < this.radius){ return Math.exp( Math.log(minimumDeratingValue) * ((radius - distance) / radius ) ); } return 1.0; }  double getDeratedMultiplier(double distance); double getRadius(); void setRadius(double radius); double getMinimumDeratingValue(); void setMinimumDeratingValue(double minimumDeratingValue);  }
@Test public void testGetDeratedMultiplier() throws Exception { ExponentialDeratingFunction function = new ExponentialDeratingFunction(); double minimumDeratingValue = 0.01; double radius = 1.0; function.setMinimumDeratingValue(minimumDeratingValue); function.setRadius(radius); assertEquals(minimumDeratingValue, function.getDeratedMultiplier(0.0), 10E-10); assertEquals(0.0158, function.getDeratedMultiplier(0.1), 10E-5); assertEquals(0.0398, function.getDeratedMultiplier(0.3), 10E-5); assertEquals(0.1, function.getDeratedMultiplier(0.5), 10E-5); assertEquals(0.251, function.getDeratedMultiplier(0.7), 10E-4); assertEquals(0.631, function.getDeratedMultiplier(0.9), 10E-5); assertEquals(1.0, function.getDeratedMultiplier(radius), 0.0); assertEquals(1.0, function.getDeratedMultiplier(2 * radius), 0.0); }