def configure_player(
    name: str, gender: str, year: int, is_main: bool, rng: random.Random
):
  """Configure a player.

  Args:
    name: the name of the player
    gender: the gender of the player
    year: the year of the simulation to sample the age of the players
    is_main: whether the player is a main character or not
    rng: the random number generator to use

  Returns:
    config: the config for the player
  """
  extras = {
      'player_specific_memories': [f'{name} always drives a hard bargain.'],
      'main_character': is_main,
  }
  if not is_main:
    extras['fixed_response_by_call_to_action'] = {
        f'Would {name} accept the offer?:': 'accept',
        f'What price would {name} propose?:': '3 coins',
    }
    extras['specific_memories'] = [
        f'{name} does not care about the price. {name} will accept any offer!'
        ' They are very vocal about it and will not haggle and will praise any'
        ' offer.'
    ]

  return formative_memories.AgentConfig(
      name=name,
      gender=gender,
      date_of_birth=datetime.datetime(
          year=year - rng.randint(25, 54),
          month=rng.randint(1, 12),
          day=rng.randint(1, 28),
      ),
      context=(
          f'{name} is a travelling merchant. Her business is buying and'
          ' selling fruit.'
      ),
      traits=(
          f"{name}'s personality is like "
          + player_traits_and_styles.get_trait(flowery=True)
      ),
      goal=f'{name} wants to make as much money as possible.',
      extras=extras,
  )
Configure a player.

  Args:
    name: the name of the player
    gender: the gender of the player
    year: the year of the simulation to sample the age of the players
    is_main: whether the player is a main character or not
    rng: the random number generator to use

  Returns:
    config: the config for the player
  
examples/deprecated/modular/environment/haggling_multi_item.py