def decomposition_function(self, comb_class: Tiling) -> Tuple[Tiling, ...]: placement_class = self.placement_class(comb_class) placed_tilings = placement_class.place_point_of_req( self.gps, self.indices, self.direction) if self.include_empty: return (comb_class.add_obstructions(self.gps), ) + placed_tilings return placed_tilings
def decomposition_function(self, tiling: Tiling) -> Tuple[Tiling, Tiling]: """ Return a tuple of tiling. The first one avoids all the pattern in the list while the other contain one of the patterns in the list. """ return tiling.add_obstructions(self.gps), tiling.add_list_requirement( self.gps)
def __call__(self, comb_class: Tiling) -> Iterator[Rule]: for req_placement, (gps, indices, direction) in product( self.req_placements(comb_class), self.req_indices_and_directions_to_place(comb_class), ): if (direction in req_placement.directions and not req_placement.already_placed(gps, indices)): strategy = RequirementPlacementStrategy( gps, indices, direction, own_row=req_placement.own_row, own_col=req_placement.own_col, ignore_parent=self.ignore_parent, include_empty=self.include_empty, ) children = req_placement.place_point_of_req( gps, indices, direction) if self.include_empty: children = (comb_class.add_obstructions(gps), ) + children yield strategy(comb_class, children)
def decomposition_function(self, comb_class: Tiling) -> Tuple[Tiling]: return (comb_class.add_obstructions(self.gps), )
def decomposition_function(self, tiling: Tiling) -> Tuple[Tiling]: return (tiling.add_obstructions(self.gps),)