Esempio n. 1
0
 def test_1(self):
     s = [{
         (8, 0): 0.07115763920497647,
         (4, 0): 0.9288423607950236
     }, {
         (2, 2): 0.5720875372542142,
         (8, 1): 0.003551851981528808,
         (4, 2): 0.0949262533069968,
         (4, 1): 0.12165095909084939,
         (2, 1): 0.20778339836641074
     }, {
         (4, 2): 0.04738902510295617,
         (8, 3): 0.047463126653498396,
         (4, 3): 0.6195506639077126,
         (2, 2): 0.2855971843358328
     }, {
         0: 0.667013790561211,
         (8, 3): 0.02369451255147808,
         (4, 3): 0.30929169688731095
     }]
     check_and_clean_row(s, clean=False)
     validate_pyramid_line(s)
     merge_prob_line(s)
     check_and_clean_row(s, clean=False)
     validate_pyramid_line(s)
Esempio n. 2
0
 def test_1(self):
     s = [
         {(8, 0): 0.07115763920497647, (4, 0): 0.9288423607950236},
         {(2, 2): 0.5720875372542142, (8, 1): 0.003551851981528808, (4, 2): 0.0949262533069968, (4, 1): 0.12165095909084939, (2, 1): 0.20778339836641074},
         {(4, 2): 0.04738902510295617, (8, 3): 0.047463126653498396, (4, 3): 0.6195506639077126, (2, 2): 0.2855971843358328},
         {0: 0.667013790561211, (8, 3): 0.02369451255147808, (4, 3): 0.30929169688731095}
     ]
     check_and_clean_row(s, clean=False)
     validate_pyramid_line(s)
     merge_prob_line(s)
     check_and_clean_row(s, clean=False)
     validate_pyramid_line(s)
Esempio n. 3
0
 def test_2(self):
     s = [
         {(8, 3): 1.2744425311006894e-33, (8, 1): 0.046480377152007805, (8, 0): 0.004131301440329217, (2, 1): 0.09296075430401561,
          (2, 0): 0.22101541432296606, (2, 3): 2.5488850622013792e-33, (4, 3): 2.082857569485455e-32, (4, 1): 0.5042479384175521,
          (4, 0): 0.13116421436312914},
         {0: 2.465190328815662e-32, (8, 2): 0.001407242050906737, (2, 2): 0.4986189702139253, (8, 1): 0.025728984987909896,
          (4, 2): 0.14366285760874367, (4, 1): 0.2791239751626947, (2, 1): 0.05145796997581979},
         {(8, 3): 0.03327713555673578, (2, 3): 0.06655427111347156, (8, 2): 0.0007789719408628102, (4, 3): 0.5438576632033683,
          (2, 2): 0.27600808739924343, (4, 2): 0.07952387078631809},
         {0: 0.6436890698735754, (8, 3): 0.018420395307461757, (2, 3): 0.03684079061492353, (4, 3): 0.3010497442040392}
     ]
     check_and_clean_row(s, clean=False)
     validate_pyramid_line(s)
     merge_prob_line(s)
     check_and_clean_row(s, clean=False)
     validate_pyramid_line(s)
Esempio n. 4
0
 def test_3(self):
     s = [
         {2: 1.0}, {256: 1.0}, {16: 1.0}, {4: 1.0},
         {16: 1.0}, {4: 1.0}, {512: 1.0}, {2: 1.0},
         {4: 1.0}, {32: 1.0}, {128: 1.0}, {32: 1.0},
         {0: 0.6666666666666667, 2: 0.3333333333333333}, {64: 1.0}, {8: 1.0}, {2: 1.0}
     ]
     put_random_prob(s)
     check_and_clean_row(s, clean=False)
     s = [
         {2: 1.0}, {0: 1.0}, {0: 1.0}, {0: 1.0},
         {0: 1.0}, {0: 1.0}, {0: 1.0}, {0: 1.0},
         {0: 1.0}, {0: 1.0}, {0: 1.0}, {0: 1.0},
         {0: 1.0}, {0: 1.0}, {0: 1.0}, {0: 1.0}
     ]
     put_random_prob(s)
     check_and_clean_row(s, clean=False)
Esempio n. 5
0
 def test_2(self):
     s = [{
         (8, 3): 1.2744425311006894e-33,
         (8, 1): 0.046480377152007805,
         (8, 0): 0.004131301440329217,
         (2, 1): 0.09296075430401561,
         (2, 0): 0.22101541432296606,
         (2, 3): 2.5488850622013792e-33,
         (4, 3): 2.082857569485455e-32,
         (4, 1): 0.5042479384175521,
         (4, 0): 0.13116421436312914
     }, {
         0: 2.465190328815662e-32,
         (8, 2): 0.001407242050906737,
         (2, 2): 0.4986189702139253,
         (8, 1): 0.025728984987909896,
         (4, 2): 0.14366285760874367,
         (4, 1): 0.2791239751626947,
         (2, 1): 0.05145796997581979
     }, {
         (8, 3): 0.03327713555673578,
         (2, 3): 0.06655427111347156,
         (8, 2): 0.0007789719408628102,
         (4, 3): 0.5438576632033683,
         (2, 2): 0.27600808739924343,
         (4, 2): 0.07952387078631809
     }, {
         0: 0.6436890698735754,
         (8, 3): 0.018420395307461757,
         (2, 3): 0.03684079061492353,
         (4, 3): 0.3010497442040392
     }]
     check_and_clean_row(s, clean=False)
     validate_pyramid_line(s)
     merge_prob_line(s)
     check_and_clean_row(s, clean=False)
     validate_pyramid_line(s)
Esempio n. 6
0
 def check(self, a, b):
     flow_prob_line(a)
     check_and_clean_row(a)
     self.assertEqual(a, b)
Esempio n. 7
0
 def test_3(self):
     s = [{
         2: 1.0
     }, {
         256: 1.0
     }, {
         16: 1.0
     }, {
         4: 1.0
     }, {
         16: 1.0
     }, {
         4: 1.0
     }, {
         512: 1.0
     }, {
         2: 1.0
     }, {
         4: 1.0
     }, {
         32: 1.0
     }, {
         128: 1.0
     }, {
         32: 1.0
     }, {
         0: 0.6666666666666667,
         2: 0.3333333333333333
     }, {
         64: 1.0
     }, {
         8: 1.0
     }, {
         2: 1.0
     }]
     put_random_prob(s)
     check_and_clean_row(s, clean=False)
     s = [{
         2: 1.0
     }, {
         0: 1.0
     }, {
         0: 1.0
     }, {
         0: 1.0
     }, {
         0: 1.0
     }, {
         0: 1.0
     }, {
         0: 1.0
     }, {
         0: 1.0
     }, {
         0: 1.0
     }, {
         0: 1.0
     }, {
         0: 1.0
     }, {
         0: 1.0
     }, {
         0: 1.0
     }, {
         0: 1.0
     }, {
         0: 1.0
     }, {
         0: 1.0
     }]
     put_random_prob(s)
     check_and_clean_row(s, clean=False)
Esempio n. 8
0
 def check(self, a, b):
     flow_prob_line(a)
     check_and_clean_row(a)
     self.assertEqual(a, b)