def run_simulation(
    *,
    model: language_model.LanguageModel,
    players: Sequence[entity_agent_with_logging.EntityAgentWithLogging],
    primary_environment: game_master.GameMaster,
    clock: game_clock.MultiIntervalClock,
    scenes: Sequence[scene_lib.SceneSpec],
    secondary_environments: Sequence[game_master.GameMaster] = tuple(),
    summarize_entire_episode_in_log: bool = True,
    compute_metrics: Callable[[Mapping[str, str]], None] | None = None,
) -> str:
  """Run a simulation.

  Args:
    model: The language model to use.
    players: The players.
    primary_environment: The main game master.
    clock: The clock of the run.
    scenes: Sequence of scenes to simulate.
    secondary_environments: Sequence of secondary game masters for scenes.
    summarize_entire_episode_in_log: Optionally, include summaries of the full
      episode in the log.
    compute_metrics: Optionally, a function to compute metrics.

  Returns:
    an HTML string log of the simulation.
  """
  # Run the simulation.
  runner.run_scenes(
      environment=primary_environment,
      scenes=scenes,
      players=players,
      clock=clock,
      compute_metrics=compute_metrics,
  )
  result_html_log = create_html_log(
      model=model,
      primary_environment=primary_environment,
      secondary_environments=secondary_environments,
      summarize_entire_episode=summarize_entire_episode_in_log,
  )
  return result_html_log
Run a simulation.

  Args:
    model: The language model to use.
    players: The players.
    primary_environment: The main game master.
    clock: The clock of the run.
    scenes: Sequence of scenes to simulate.
    secondary_environments: Sequence of secondary game masters for scenes.
    summarize_entire_episode_in_log: Optionally, include summaries of the full
      episode in the log.
    compute_metrics: Optionally, a function to compute metrics.

  Returns:
    an HTML string log of the simulation.
  
concordia/deprecated/factory/environment/basic_game_master.py