示例#1
0
 def test_alpha(self, x, lower, upper):
     assume(lower < upper)
     f = fun.alpha(floor=lower, ceiling=upper, func=fun.noop())
     if x <= lower:
         assert f(x) == lower
     elif x >= upper:
         assert f(x) == upper
     else:
         assert f(x) == x
示例#2
0
 def test_alpha_2(self, x, floor, ceil, floor_clip, ceil_clip):
     assume(floor < ceil)
     if not (floor_clip is None or ceil_clip is None):
         assume(floor_clip < ceil_clip)
     f = fun.alpha(floor=floor,
                   ceiling=ceil,
                   func=fun.noop(),
                   floor_clip=floor_clip,
                   ceiling_clip=ceil_clip)
     assert 0 <= f(x) <= 1
示例#3
0
 def test_einstein_sum(self, x):
     a = fun.noop()
     b = fun.noop()
     f = combi.einstein_sum(a, b)
     assert 0 <= f(x) <= 1
示例#4
0
 def test_lukasiewicz_OR(self, x):
     a = fun.noop()
     b = fun.noop()
     f = combi.lukasiewicz_OR(a, b)
     assert 0 <= f(x) <= 1
示例#5
0
 def test_bounded_sum(self, x):
     a = fun.noop()
     b = fun.noop()
     f = combi.bounded_sum(a, b)
     assert 0 <= f(x) <= 1
示例#6
0
 def test_inv(self, x):
     assume(0 <= x <= 1)
     f = fun.inv(fun.noop())
     assert isclose(f(f(x)), x, abs_tol=1e-16)
示例#7
0
 def test_MIN(self, x):
     a = fun.noop()
     b = fun.noop()
     f = combi.MIN(a, b)
     assert (0 <= f(x) <= 1)
示例#8
0
 def test_gamma_op(self, x, g):
     a = fun.noop()
     b = fun.noop()
     g = combi.gamma_op(g)
     f = g(a, b)
     assert 0 <= f(x) <= 1
示例#9
0
 def test_very(self, x):
     s = Set(fun.noop())
     f = hedges.very(s)
     assert 0 <= f(x) <= 1
示例#10
0
 def test_noop(self, x):
     f = fun.noop()
     assert f(x) == x
示例#11
0
 def test_hamacher_product(self, x):
     a = fun.noop()
     b = fun.noop()
     f = combi.hamacher_product(a, b)
     assert (0 <= f(x) <= 1)
示例#12
0
 def test_einstein_product(self, x):
     a = fun.noop()
     b = fun.noop()
     f = combi.einstein_product(a, b)
     assert (0 <= f(x) <= 1)
示例#13
0
 def test_lukasiewicz_AND(self, x):
     a = fun.noop()
     b = fun.noop()
     f = combi.lukasiewicz_AND(a, b)
     assert (0 <= f(x) <= 1)
示例#14
0
 def test_hamacher_sum(self, x):
     a = fun.noop()
     b = fun.noop()
     f = combi.hamacher_sum(a, b)
     assert 0 <= f(x) <= 1
示例#15
0
 def test_plus(self, x):
     s = Set(fun.noop())
     f = hedges.plus(s)
     assert 0 <= f(x) <= 1
示例#16
0
 def test_lambda_op(self, x, l):
     a = fun.noop()
     b = fun.noop()
     g = combi.lambda_op(l)
     f = g(a, b)
     assert 0 <= f(x) <= 1
示例#17
0
 def test_MAX(self, x):
     a = fun.noop()
     b = fun.noop()
     f = combi.MAX(a, b)
     assert 0 <= f(x) <= 1
示例#18
0
 def test_hamacher_sum(self, x):
     a = fun.noop()
     b = fun.noop()
     f = combi.simple_disjoint_sum(a, b)
     assert 0 <= f(x) <= 1
示例#19
0
 def test_product(self, x):
     a = fun.noop()
     b = fun.noop()
     f = combi.product(a, b)
     assert 0 <= f(x) <= 1
示例#20
0
 def test_moderate(self, x):
     f = fun.moderate(fun.noop())
     assert 0 <= f(x) <= 1
示例#21
0
 def test_minus(self, x):
     s = Set(fun.noop())
     f = hedges.minus(s)
     assert (0 <= f(x) <= 1)