예제 #1
0
def generate_random_flipped_space(X:Binary, runs=None):
    if runs is None:
        runs == 1000 #2**len(X)
    
    space = [X]
    a = Binary()
    for i in range(runs):
        X = a.combine_string(X)
        
        X.flip_random_bit()
        X = a.split_string(X)
        space.append(X)
    return space
예제 #2
0
def test_combine_string():
    a = (Binary('1111'), Binary('0000'), Binary('1111'), Binary('0000'))
    A = Binary('1111000011110000')
    assert A.combine_string(a) == A