def configure_players(sampled_settings: Any, rng: random.Random) -> tuple[
    list[formative_memories.AgentConfig],
    list[formative_memories.AgentConfig],
]:
  """Configure the players.

  Args:
    sampled_settings: the sampled settings for the world configuration
    rng: the random number generator to use

  Returns:
    main_player_configs: configs for the main characters
    supporting_player_configs: configs for the supporting characters
  """
  names = sampled_settings.people[
      : sampled_settings.num_main_players
      + sampled_settings.num_supporting_players
  ]
  all_players = ', '.join(names)
  player_configs = []

  num_pubs = len(sampled_settings.venues)

  for i in range(sampled_settings.num_main_players):
    name = names[i]
    if 'favorite_pub' in sampled_settings.person_data[name]:
      favorite_pub = sampled_settings.person_data[name]['favorite_pub']
    else:
      favorite_pub = sampled_settings.venues[i % num_pubs]

    friend_names = _get_friends_names(
        name, names, sampled_settings.relationship_matrix
    )
    gender = sampled_settings.person_data[name]['gender']
    config = configure_player(
        name,
        gender,
        favorite_pub,
        is_main=True,
        all_player_names_str=all_players,
        friend_names_str=friend_names,
        pub_preferences=sampled_settings.venue_preferences,
        year=sampled_settings.year,
        rng=rng,
    )
    player_configs.append(config)

  for i in range(sampled_settings.num_supporting_players):
    name = names[sampled_settings.num_main_players + i]
    gender = sampled_settings.person_data[name]['gender']
    if 'favorite_pub' in sampled_settings.person_data[name]:
      favorite_pub = sampled_settings.person_data[name]['favorite_pub']
    else:
      favorite_pub = sampled_settings.venues[1]

    friend_names = _get_friends_names(
        name, names, sampled_settings.relationship_matrix
    )
    config = configure_player(
        name,
        gender,
        favorite_pub,
        is_main=False,
        all_player_names_str=all_players,
        friend_names_str=friend_names,
        pub_preferences=sampled_settings.venue_preferences,
        year=sampled_settings.year,
        rng=rng,
    )
    player_configs.append(config)

  main_player_configs = [
      player for player in player_configs if player.extras['main_character']
  ]
  supporting_player_configs = [
      player for player in player_configs if not player.extras['main_character']
  ]

  return main_player_configs, supporting_player_configs
Configure the players.

  Args:
    sampled_settings: the sampled settings for the world configuration
    rng: the random number generator to use

  Returns:
    main_player_configs: configs for the main characters
    supporting_player_configs: configs for the supporting characters
  
examples/deprecated/modular/environment/pub_coordination.py