parameters: (env, trained_agents, random_agents, num_episodes)
return_statement: return sum_episode_rewards / num_episodes
docstring: Evaluates `trained_agents` against `random_agents` for `num_episodes`.
docstring_summary: Evaluates `trained_agents` against `random_agents` for `num_episodes`.
docstring_tokens: Evaluates trained_agents against random_agents for num_episodes .
function: def eval_against_random_bots(env, trained_agents, random_agents, num_episodes):
    """Evaluates `trained_agents` against `random_agents` for `num_episodes`."""
    num_players = len(trained_agents)
    sum_episode_rewards = np.zeros(num_players)
    for player_pos in range(num_players):
      for _ in range(num_episodes):
        cur_agents = random_agents[:]
        if FLAGS.randomize_positions:
          eval_player_pos = random.randrange(num_players)
        else:
          eval_player_pos = player_pos
        cur_agents[eval_player_pos] = trained_agents[player_pos]
        cur_agents[eval_player_pos].player_id = eval_player_pos
        time_step = env.reset()
        episode_rewards = 0
        while not time_step.last():
          player_id = time_step.observations["current_player"]
          agent_output = cur_agents[player_id].step(
              time_step, is_evaluation=True)
          action_list = [agent_output.action]
          time_step = env.step(action_list)
          episode_rewards += time_step.rewards[eval_player_pos]
        sum_episode_rewards[player_pos] += episode_rewards
    return sum_episode_rewards / num_episodes
function_tokens: def eval_against_random_bots ( env , trained_agents , random_agents , num_episodes ) : num_players = len ( trained_agents ) sum_episode_rewards = np . zeros ( num_players ) for player_pos in range ( num_players ) : for _ in range ( num_episodes ) : cur_agents = random_agents [ : ] if FLAGS . randomize_positions : eval_player_pos = random . randrange ( num_players ) else : eval_player_pos = player_pos cur_agents [ eval_player_pos ] = trained_agents [ player_pos ] cur_agents [ eval_player_pos ] . player_id = eval_player_pos time_step = env . reset ( ) episode_rewards = 0 while not time_step . last ( ) : player_id = time_step . observations [ "current_player" ] agent_output = cur_agents [ player_id ] . step ( time_step , is_evaluation = True ) action_list = [ agent_output . action ] time_step = env . step ( action_list ) episode_rewards += time_step . rewards [ eval_player_pos ] sum_episode_rewards [ player_pos ] += episode_rewards return sum_episode_rewards / num_episodes