EpsilonAdaptationDelta implements EpsilonAdaptation { @Override public void adaptEpsilon(AdaptiveEpsilon adaptiveEpsilon, boolean epsilonTooBig) { if (epsilonTooBig) { adaptiveEpsilon.setEpsilon(adaptiveEpsilon.getEpsilon() - adaptiveEpsilon.getEpsilonDelta()); adaptiveEpsilon.setEpsilonDelta(adaptiveEpsilon.getEpsilonDelta() / 2); } else { adaptiveEpsilon.setEpsilon(adaptiveEpsilon.getEpsilon() + adaptiveEpsilon.getEpsilonDelta()); adaptiveEpsilon.setEpsilonDelta(adaptiveEpsilon.getEpsilonDelta() * 2); } }  @Override void adaptEpsilon(AdaptiveEpsilon adaptiveEpsilon, boolean epsilonTooBig);  }
@Test public void testEpsilonSample() { EpsilonAdaptationDelta adaptation = new EpsilonAdaptationDelta(); AdaptiveEpsilon adaptiveEpsilon = new AdaptiveEpsilon(eps_start, eps_delta_start, eps_delta_max, eps_delta_min); adaptation.adaptEpsilon(adaptiveEpsilon, false); assertEquals(0.5, adaptiveEpsilon.getEpsilon(), 0.0); assertEquals(1.0, adaptiveEpsilon.getEpsilonDelta(), 0.0); adaptation.adaptEpsilon(adaptiveEpsilon, false); assertEquals(1.5, adaptiveEpsilon.getEpsilonDelta(), 0.0); assertEquals(1.5, adaptiveEpsilon.getEpsilon(), 0.0); adaptation.adaptEpsilon(adaptiveEpsilon, true); assertEquals(0.0, adaptiveEpsilon.getEpsilon(), 0.0); assertEquals(0.75, adaptiveEpsilon.epsilonDelta, 0.0); adaptation.adaptEpsilon(adaptiveEpsilon, true); assertEquals(-.75, adaptiveEpsilon.getEpsilon(), 0.0); assertEquals(0.4, adaptiveEpsilon.epsilonDelta, 0.0); }