def getDimensionSmallNeighbours(self, from_, dim): coord = Coordinates(from_) val = coord.getDimension(dim) smaller = Coordinates(from_) smaller.setDimension(dim, val - 1) if smaller in self.gridList: return smaller return coord
def getDimensionBigNeighbours(self, from_, dim): coord = Coordinates(from_) val = coord.getDimension(dim) bigger = Coordinates(from_) bigger.setDimension(dim, val + 1) if bigger in self.gridList: return bigger return coord