class World: def __init__(self, path = None): global args if path is None: path = args.infile self.recording_file_path = path self.left = -2. self.right = 2. self.top = 2. self.bottom = -2. self.car = FakeCar(recording_file_path = self.recording_file_path) def width(self): return abs(self.right-self.left) def height(self): return abs(self.top-self.bottom) def inflate_to_include(self,x,y): self.left = min(self.left, x) self.right = max(self.right, x) self.top = max(self.top,y) self.bottom = min(self.bottom,y) def move(self): if self.car.step() == False: self.car.reset() self.inflate_to_include(self.car.ackerman.x+2,self.car.ackerman.y+2) self.inflate_to_include(self.car.ackerman.x-2,self.car.ackerman.y-2)