예제 #1
0
 def test_Lab(self):
     self.assertEqual(
         round(
             main.calcSystemProb('((2&4)|1)&((3&8)|(6&7)|(5))', [.95] * 8),
             6), .994652)
     self.assertEqual(
         round(
             main.calcSystemProb('((1|2|3)&(6|(4&5))&(7|(8&(11|9|10))))|12',
                                 [.95] * 12), 6), .999625)
예제 #2
0
 def test_SimpleFunctionOr(self):
     self.assertEqual(main.calcSystemProb('(1|2)', [6, 2]),
                      main.TonyOr(6, 2))
예제 #3
0
 def test_SimpleOr(self):
     self.assertEqual(main.calcSystemProb('(1|2)', [5, 3]), 5 + 3 - 15)
예제 #4
0
 def test_LabHard(self):
     self.assertEqual(main.calcSystemProb('(1|2)', [6, 2]),
                      main.TonyOr(6, 2))
예제 #5
0
 def test_Hard(self):
     self.assertEqual(main.calcSystemProb('(1|2)&3', [5, 3, 62]),
                      (5 + 3 - 15) * 62)
예제 #6
0
 def test_SimpleFunctionAnd(self):
     self.assertEqual(main.calcSystemProb('(1&2)', [15, 3]), 15 * 3)
예제 #7
0
 def test_SimpleAnd(self):
     self.assertEqual(main.calcSystemProb('(1&2)', [5, 3]), 15)
예제 #8
0
 def test_compoundOr(self):
     self.assertEqual(main.calcSystemProb('(1|2|3)', [5, 3, 4]),
                      main.TonyOr(main.TonyOr(5, 3), 4))