def METHOD_NAME(self, timetolive, position=None, agenttype=None):
    """
    Set a new agent into the world
    @param int number of cycles the agent has to live
    @param list coordinates to put the agent on, none for a random position
    @param agenttype the type of agent to be spawned
    @return agent the newly created agent
    """
    position = self.findposition(position)
    if not position:
        raise error.DataError(
            "r.agent::libagent.world.World.bear()", "invalid position"
        )
    agent = self.agenttype(timetolive, self, position)
    self.agents.append(agent)
    return agent