def generate_world(self): print('GENERATING WORLD') world = World() world.is_reward_shared = False world.is_discrete = True world.agents = [] world.special_objects = [] # Create attacker agent agent = Agent() agent.can_grab = False agent.uuid = 'a_0_agent' agent.view_range = np.inf agent.state.mass = 1 agent.state.size = 1 agent.color = 'red' world.agents.append(agent) # Setup objective in world goal = SpecialObject() goal.uuid = f'o_0_goal' goal.state.mass = 1 goal.state.size = 1 world.special_objects.append(goal) return world
def generate_world(self): print('GENERATING WORLD') world = World() world.state.size = (20, 20) world.is_reward_shared = False world.is_discrete = True world.agents = [Agent(), Agent(), Agent(), Agent()] world.special_objects = [SpecialObject()] for i, agent in enumerate(world.agents): agent.can_grab = False agent.uuid = f'a_{i}' agent.view_range = np.inf agent.state.mass = 1 agent.state.size = 1 for j, special_obj in enumerate(world.special_objects): special_obj.uuid = f'o_{j}' special_obj.state.mass = 3 special_obj.state.size = 1.5 world.agents[0].color = 'green' world.agents[1].color = 'blue' world.agents[2].color = 'red' world.agents[0].state.mass = 3 world.state.timestamp = 0.1 return world
def generate_world(self): print('GENERATING WORLD') world = World() world.is_reward_shared = False world.is_discrete = True world.agents = [] world.special_objects = [] # Agent that is gonna attemt to move object from a to b agent = Agent() agent.can_grab = False agent.uuid = 'a_0_agent' agent.view_range = np.inf agent.state.mass = 3 agent.state.size = 1 agent.color = 'blue' world.agents.append(agent) # Object to be delivered by agent to certain point obj = SpecialObject() obj.uuid = f'o_0_object' obj.state.mass = 1 obj.state.size = 1 obj.can_be_moved = True obj.can_collide = True obj.color = 'green' world.special_objects.append(obj) return world
def generate_world(self): print('GENERATING WORLD') world = World() world.state.size = (20, 20) world.is_reward_shared = False world.is_discrete = True world.agents = [] world.special_objects = [] world.achieved_goal = False # Agent that gonna be a hunter and need to catch the pray hunter = Agent() hunter.can_grab = False hunter.uuid = 'a_0_hunter' hunter.view_range = np.inf hunter.state.mass = 3 hunter.state.size = 1 hunter.color = 'blue' world.agents.append(hunter) # Agent that gonna be a pray and need to escape the hunter pray = Agent() pray.can_grab = False pray.uuid = 'a_1_pray' pray.view_range = np.inf pray.state.mass = 5 pray.state.size = 1 pray.color = 'green' world.agents.append(pray) # Obstacle object obstacle = SpecialObject() obstacle.uuid = f'o_0_obstacle' obstacle.state.mass = 1 obstacle.state.size = 2 obstacle.color = 'red' world.special_objects.append(obstacle) return world
def generate_world(self): print('GENERATING WORLD') world = World() world.state.size = (50, 50) world.is_reward_shared = False world.is_discrete = True world.agents = [] world.special_objects = [] # Create attacker agent attacker = Agent() attacker.can_grab = False attacker.uuid = 'a_0_attacker' attacker.view_range = np.inf attacker.state.mass = 1 attacker.state.size = 1 attacker.color = 'red' world.agents.append(attacker) # Create defender agent defender = Agent() defender.can_grab = False defender.uuid = 'a_1_defender' defender.view_range = np.inf defender.state.mass = 3 defender.state.size = 2 defender.color = 'green' world.agents.append(defender) # Setup objective in world goal = SpecialObject() goal.uuid = f'o_0_goal' goal.state.mass = 1 goal.state.size = 3 world.special_objects.append(goal) return world
def generate_world(self): print('GENERATING WORLD') world = World() world.state.size = (20, 20) world.is_reward_shared = False world.is_discrete = True world.agents = [Agent()] world.special_objects = [SpecialObject()] for i, agent in enumerate(world.agents): agent.can_grab = False agent.uuid = f'a_{i}' agent.view_range = np.inf agent.state.mass = 1 for j, special_obj in enumerate(world.special_objects): special_obj.uuid = f'o_{j}' special_obj.state.mass = 1 special_obj.state.size = 2 return world
def generate_world(self): print('GENERATING WORLD') world = World() world.is_reward_shared = False world.is_discrete = True world.agents = [] world.special_objects = [] # Create attacker agent agent = Agent() agent.can_grab = False agent.uuid = 'a_0_agent' agent.view_range = np.inf agent.state.mass = 3 agent.state.size = 1 agent.color = 'blue' world.agents.append(agent) # Setup objective in world goal = SpecialObject() goal.uuid = f'o_0_goal' goal.state.mass = 1 goal.state.size = 1 goal.color = 'green' world.special_objects.append(goal) # create 4obstacles that builds a wall for i in range(0, 7): wall_part_obj = SpecialObject() wall_part_obj.uuid = f'o_{i}_wall' wall_part_obj.state.mass = 1 wall_part_obj.state.size = 1 wall_part_obj.color = 'red' world.special_objects.append(wall_part_obj) return world