def create_random_agent(self, color=None, shape_name='netlogo_figure', scale=1.4): """ Create an Agent placed randomly on the screen. Set it to face the screen's center pixel. """ agent = self.agent_class(color=color, shape_name=shape_name, scale=scale) agent.move_to_xy(Pixel_xy.random_pixel()) agent.face_xy(center_pixel()) return agent
def create_random_agents(self, n, shape_name='netlogo_figure', color=None, scale=1.4): """ Create n Agents placed randomly on the screen. They are all facing the screen's center pixel. """ for _ in range(n): agent = self.agent_class(color=color, shape_name=shape_name, scale=scale) agent.move_to_xy(Pixel_xy.random_pixel()) agent.face_xy(center_pixel())