def configure_players(
    sampled_settings: WorldConfig,
    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

  player_configs = []
  for i in range(sampled_settings.num_main_players):
    name = names[i]
    gender = sampled_settings.person_data[name]['gender']

    config = configure_player(
        name, gender, sampled_settings.year, is_main=True, rng=rng
    )
    player_configs.append(config)

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

    config = configure_player(
        name,
        gender,
        sampled_settings.year,
        is_main=False,
        rng=rng,
        supporting_player_parameters=sampled_settings.supporting_player_parameters,
    )

    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/haggling.py