Exemplo n.º 1
0
 def test_trapezoidal_membership_function(self):
     self.assertRaises(
         TypeError, lambda: trapmf.trapmf(2.0, [-2.0, -0.5, 0.5, 2.5, 3.3]))
Exemplo n.º 2
0
 def test_trapezoidal_membership_function20(self):
     self.assertAlmostEqual(trapmf.trapmf(-0.1, [-4.0, -2.5, -1.5, -0.5]),
                            0.0,
                            places=4)
Exemplo n.º 3
0
 def test_trapezoidal_membership_function48(self):
     self.assertAlmostEqual(trapmf.trapmf(6.0, [1.0, 3.0, 4.0, 5.5]),
                            0.0,
                            places=4)
Exemplo n.º 4
0
 def test_trapezoidal_membership_function4(self):
     self.assertRaises(TypeError, lambda: trapmf.trapmf(2.0, []))
Exemplo n.º 5
0
 def test_trapezoidal_membership_function37(self):
     self.assertAlmostEqual(trapmf.trapmf(3.0, [-2.0, -0.5, 0.5, 2.5]),
                            0.0,
                            places=4)
Exemplo n.º 6
0
 def test_trapezoidal_membership_function26(self):
     self.assertAlmostEqual(trapmf.trapmf(-0.7, [-2.0, -0.5, 0.5, 2.5]),
                            0.8667,
                            places=4)
Exemplo n.º 7
0
 def test_trapezoidal_membership_function24(self):
     self.assertAlmostEqual(trapmf.trapmf(-1.8, [-2.0, -0.5, 0.5, 2.5]),
                            0.1333,
                            places=4)