refactoring

This commit is contained in:
Matthias Bisping 2022-04-05 19:03:31 +02:00
parent 4bc295b212
commit 11fc63035d

View File

@ -52,7 +52,8 @@ class BoxSplitter:
def __split_and_recurse(self, box, step):
new_boxes = self.__random_split(box)
return chain.from_iterable(self.__tree_recurse(new_boxes, step + 1))
new_boxes_per_branch = self.__tree_recurse(new_boxes, step + 1)
return chain.from_iterable(new_boxes_per_branch)
def __random_split(self, box):
splitter = random.choice([self.__split_horizontal, self.__split_vertical])