Exemplo n.º 1
0
    ax.set_zlabel('Z Label')

    plt.show()

dims = 3
k = 20
bucket_size = 50
C = 45
bucket_a = Bucket(1, C, k, bucket_size)
bucket_b = Bucket(2, C, k, bucket_size)
bucket_c = Bucket(3, C, k, bucket_size)
bucket_d = Bucket(4, C, k, bucket_size)

# Zipping datasets a, b, c and d
data_a = list(zip(data_x_a, data_y_a, data_z_a))
data_b = list(zip(data_x_b, data_y_b, data_z_b))
data_c = list(zip(data_x_c, data_y_c, data_z_c))
data_d = list(zip(data_x_d, data_y_d, data_z_d))
print("Zipped dataset: ", (data_d))

# Note the hash is the bucket!

for tuple in data_d:
    #print("Tuple: ", tuple)
    #print("Unary form: ", to_unary(tuple, 45))
    hash_a = bucket_a.hash_element(to_unary(tuple, 45))
    # hash_b = bucket_b.hash_element(to_unary(tuple, 45))
    # hash_c = bucket_c.hash_element(to_unary(tuple, 45))
    # hash_d = bucket_d.hash_element(to_unary(tuple, 45))

    print(hash_a)