def cache_children(self, canonical=False): """ :return: Same as get_children, but in canonical form """ self.children, self.child_groupmaps = GoGame.get_children( self.state, self.group_map) children = self.children.copy() child_groupmaps = self.child_groupmaps.copy() if canonical: for i in range(len(children)): children[i] = GoGame.get_canonical_form(children[i]) return children, child_groupmaps
def get_children(self, canonical=False): """ :return: Same as get_children, but in canonical form """ return GoGame.get_children(self.state, self.group_map, canonical)