code: def spawn_agent(self, agent_definition, location):
          
          self._should_write_to_command_buffer = True
          self._add_agents(agent_definition)
          command_to_send = SpawnAgentCommand(location, agent_definition.name, agent_definition.type)
          self._commands.add_command(command_to_send)
docs: Queues a spawn agent command. It will be applied when `tick` or `step` is called next.
          The agent won't be able to be used until the next frame.
  
          Args:
              agent_definition (:obj:`AgentDefinition`): The definition of the agent to spawn.
              location (np.ndarray or list): The position to spawn the agent in the world, in XYZ coordinates (in meters).