def setOffset(self, offset): self.offset = offset self.partition.stop() self.partition = Partition( offset, self.container.points, self.obstacles )
def __init__(self, offset, xml_filename): self.areas = {} self.vertices = {} self.width = 0 self.height = 0 self.obstacles = [] self.dynamic_obstacles = [] self.offset = offset self.load_xml(xml_filename) self.container = Poly(((0,0),(self.width,0),(self.width,self.height),(0,self.height))) self.partition = Partition( offset, self.container.points, self.obstacles ) self.calc_areas() self.calc_vertex_graph() self.pathfinding_area = AStar(self.areas.values(), NAVGRAPH) self.pathfinding_vertices = AStar(self.vertices.values(), NAVGRAPH)