def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
height = self.height
width = self.width
domain = Polygon([(0, 0), (0, height), (width, height), (width, 0)])
target = LineString([(0, height / 2), (0, height)])
spawn = Polygon([(0, 0),
(0, height / 2),
(width / 2, height / 2),
(width / 2, 0)])
obstacles = LineString([(0, height / 2),
(width * self.ratio, height / 2)]) | \
domain.exterior - target
self.obstacles = obstacles
self.targets = [target]
self.spawns = [spawn]
self.domain = domain
评论列表
文章目录