def test_ei_zero_division(self):
     ei = ExpectedImprovement()
     ei.target = 1.0
     ei.current = NormalDistribution(mu=1, sigma=0)
     ei.execute()
     self.assertEqual(0, ei.EI)
     self.assertEqual(0, ei.PI)
 def test_ei_zero_division(self):
     ei = ExpectedImprovement()
     ei.target = 1.0
     ei.current = NormalDistribution(mu=1, sigma=0)
     ei.execute()
     self.assertEqual(0,ei.EI)
     self.assertEqual(0,ei.PI)
 def test_ei(self):
     ei = ExpectedImprovement()
     ei.target = 1.0
     ei.current = NormalDistribution(mu=1, sigma=1)
     ei.execute()
     self.assertAlmostEqual([0.40], ei.EI, 2)
     self.assertAlmostEqual(0.5, ei.PI, 6)
 def test_ei(self):
     ei = ExpectedImprovement()
     ei.target = 1.0
     ei.current = NormalDistribution(mu=1, sigma=1)
     ei.execute()
     self.assertAlmostEqual([0.40],ei.EI,2)
     self.assertAlmostEqual(0.5,ei.PI,6)