def __init__(
      self,
      model: language_model.LanguageModel,
      embedder: Callable[[str], np.ndarray],
      measurements: measurements_lib.Measurements,
      setup_time: datetime.datetime,
      scenes: Sequence[scene_lib.SceneSpec],
      player_configs: list[formative_memories.AgentConfig],
      agent_module: types.ModuleType = basic_agent,
      premise: str | None = None,
      fast_gm: bool = False,
  ):
    """Initialize the simulation object.

    The launch script assumes this API object has a run() method.

    Args:
      model: the language model to use.
      embedder: the sentence transformer to use.
      measurements: the measurements object to use.
      setup_time: the time to start the simulation at.
      scenes: the scene storyboard structure.
      player_configs: configs for the main characters
      agent_module: the agent module to use for all main characters.
      premise: the premise for the scene
      fast_gm: if set to True then use a faster debug game master. This is not
        recommended for real experiments. The debug game master uses a thought
        chain which allows for unrealistic events. In particular, it allows
        agent hallucination to force other agents to take voluntary actions they
        would not take on their own. It also allows game master hallucination to
        override quotes from the players, substituting what the agents wanted to
        say for arbitrary other text generated by the game master without
        reference to the memories or components of the agents involved.
    """

    self._agent_module = agent_module
    self._model = model
    self._embedder = embedder
    self._measurements = measurements

    self._clock = game_clock.MultiIntervalClock(
        start=setup_time, step_sizes=[MAJOR_TIME_STEP, MINOR_TIME_STEP]
    )

    importance_model = importance_function.AgentImportanceModel(self._model)
    importance_model_gm = importance_function.ConstantImportanceModel()
    self._blank_memory_factory = blank_memories.MemoryFactory(
        model=self._model,
        embedder=self._embedder,
        importance=importance_model.importance,
        clock_now=self._clock.now,
    )
    self._formative_memory_factory = formative_memories.FormativeMemoryFactory(
        model=self._model,
        shared_memories=[],
        blank_memory_factory_call=self._blank_memory_factory.make_blank_memory,
        current_date=setup_time,
    )

    main_player_configs = list(player_configs)
    random.shuffle(main_player_configs)

    tasks = {
        config.name: functools.partial(
            self._make_player_memories, config=config
        )
        for config in main_player_configs
    }
    self._all_memories = concurrency.run_tasks(tasks)

    main_players = []
    for _, player_config in enumerate(main_player_configs):
      kwargs = dict(
          config=player_config,
          model=self._model,
          memory=self._all_memories[player_config.name],
          clock=self._clock,
          update_time_interval=MAJOR_TIME_STEP,
      )
      player = self._agent_module.build_agent(**kwargs)

      main_players.append(player)

    self._all_players = main_players

    game_master_memory = associative_memory.AssociativeMemory(
        sentence_embedder=self._embedder,
        importance=importance_model_gm.importance,
        clock=self._clock.now,
    )
    self._game_master_memory = game_master_memory

    if fast_gm:
      thought_chain = (
          thought_chains_lib.attempt_to_result,
          thought_chains_lib.result_to_who_what_where,
      )
    else:
      thought_chain = None

    self._primary_environment, self._game_master_memory = (
        basic_game_master.build_game_master(
            model=self._model,
            embedder=self._embedder,
            importance_model=importance_model_gm,
            clock=self._clock,
            players=self._all_players,
            shared_memories=[],
            shared_context=premise,
            blank_memory_factory=self._blank_memory_factory,
            cap_nonplayer_characters_in_conversation=2,
            memory=game_master_memory,
            thought_chain=thought_chain,
            verbose=False,
        )
    )

    self._scenes = scenes

    self._secondary_environments = []

    self._init_premise_memories(
        setup_time=setup_time,
        main_player_configs=main_player_configs,
        shared_memories=[premise],
        scenario_premise=[],
    )
Initialize the simulation object.

    The launch script assumes this API object has a run() method.

    Args:
      model: the language model to use.
      embedder: the sentence transformer to use.
      measurements: the measurements object to use.
      setup_time: the time to start the simulation at.
      scenes: the scene storyboard structure.
      player_configs: configs for the main characters
      agent_module: the agent module to use for all main characters.
      premise: the premise for the scene
      fast_gm: if set to True then use a faster debug game master. This is not
        recommended for real experiments. The debug game master uses a thought
        chain which allows for unrealistic events. In particular, it allows
        agent hallucination to force other agents to take voluntary actions they
        would not take on their own. It also allows game master hallucination to
        override quotes from the players, substituting what the agents wanted to
        say for arbitrary other text generated by the game master without
        reference to the memories or components of the agents involved.
    
examples/deprecated/open_ended/open_ended.py