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_canonical_state(self): """ :return: canonical shallow copy of state """ return GoGame.get_canonical_form(self.state)
def get_canonical_state(self): return GoGame.get_canonical_form(self.state)