fix split shuffle
This commit is contained in:
@@ -63,9 +63,13 @@ class UserKeypad:
|
||||
self.keypad = dispersed_keypad.reshape(-1)
|
||||
|
||||
def split_shuffle(self):
|
||||
# shuffle all keys
|
||||
keypad_view = self.keypad_matrix()
|
||||
np.random.shuffle(keypad_view)
|
||||
# select half the property sets
|
||||
prop_permutation = np.random.permutation(self.keypad_size.props_per_key)[: self.keypad_size.props_per_key // 2]
|
||||
key_permutation = np.random.permutation(self.keypad_size.numb_of_keys)
|
||||
keypad_view = self.keypad_matrix().copy()
|
||||
# shuffle the selected property sets to new keys as a group
|
||||
keypad_view[:, prop_permutation] = keypad_view[key_permutation, :][:, prop_permutation]
|
||||
self.keypad = keypad_view.reshape(-1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user