def sample_parameters(seed: int | None = None):
  """Samples a set of parameters for the world configuration."""
  seed = seed if seed is not None else random.getrandbits(63)
  rng = random.Random(seed)

  pubs = rng.sample(list(PUB_PREFERENCES.keys()), NUM_PUBS)
  pub_preferences = {k: PUB_PREFERENCES[k] for k in pubs}

  config = pub_coordination.WorldConfig(
      year=YEAR,
      location="London",
      event="European football cup",
      game_countries=EURO_CUP_COUNTRIES,
      venues=pubs,
      venue_preferences=pub_preferences,
      social_context=SOCIAL_CONTEXT,
      random_seed=seed,
      num_supporting_players=0,
  )

  all_names = list(MALE_NAMES) + list(FEMALE_NAMES)

  rng.shuffle(all_names)
  config.people = all_names

  for _, name in enumerate(MALE_NAMES):
    config.person_data[name] = {"gender": "male"}
  for _, name in enumerate(FEMALE_NAMES):
    config.person_data[name] = {"gender": "female"}

  return config
Samples a set of parameters for the world configuration.
examples/deprecated/modular/environment/modules/pub_coordination_london.py