def __init__(
      self,
      model: language_model.LanguageModel,
      memory: associative_memory.AssociativeMemory,
      buyer_base_reward_per_item: Mapping[str, float],
      seller_base_reward_per_item: Mapping[str, float],
      action_to_reward: Mapping[str, float],
      multi_action_formatting_string: str,
      buyer: entity_agent.EntityAgent,
      seller: entity_agent.EntityAgent,
      resolution_scene: str,
      acting_player_names: Sequence[str],
      outcome_summarization_fn: Callable[
          [Mapping[str, str], Mapping[str, float]], Mapping[str, str]
      ],
      clock_now: Callable[[], datetime.datetime],
      name: str = 'scoring function',
      verbose: bool = False,
  ):
    """Initialize a scoring function component.

    Args:
      model: a language model
      memory: an associative memory
      buyer_base_reward_per_item: the base reward for the buyer per item
      seller_base_reward_per_item: the base reward for the seller per item
      action_to_reward: a mapping from action to reward
      multi_action_formatting_string: a format string for a multi-item action,
        where {item} and {price} are replaced by the item and price strings.
      buyer: the buyer agent
      seller: the seller agent
      resolution_scene: on which scene type should this component be updated
        after the event, i.e. when to check the joint action and compute results
      acting_player_names: sequence of names of players who act each stage
      outcome_summarization_fn: function of joint actions and rewards which
        returns an outcome description message for each player
      clock_now: Function to call to get current time.
      name: name of this component e.g. Possessions, Account, Property, etc
      verbose: whether to print the full update chain of thought or not
    """

    self._model = model
    self._memory = memory

    self._players = [buyer, seller]
    self._buyer_base_reward_per_item = buyer_base_reward_per_item
    self._seller_base_reward_per_item = seller_base_reward_per_item

    # check that they have the same keys
    if set(buyer_base_reward_per_item.keys()) != set(
        seller_base_reward_per_item.keys()
    ):
      raise ValueError(
          'buyer_base_reward_per_item and seller_base_reward_per_item must have'
          ' the same keys.'
      )

    self._acting_player_names = acting_player_names
    self._action_to_reward = action_to_reward
    self._outcome_summarization_fn = outcome_summarization_fn
    self._clock_now = clock_now
    self._name = name
    self._verbose = verbose
    self._buyer = buyer
    self._seller = seller
    self._multi_action_formatting_string = multi_action_formatting_string

    self._history = []
    self._state = ''
    self._partial_states = {player.name: '' for player in self._players}
    self._player_scores = {player.name: 0 for player in self._players}

    self._resolution_scene = resolution_scene
    self._current_scene = current_scene.CurrentScene(
        name='current scene type',
        memory=self._memory,
        clock_now=self._clock_now,
        verbose=self._verbose,
    )

    self.reset()
    # Set the initial state's string representation.
    self.update()
Initialize a scoring function component.

    Args:
      model: a language model
      memory: an associative memory
      buyer_base_reward_per_item: the base reward for the buyer per item
      seller_base_reward_per_item: the base reward for the seller per item
      action_to_reward: a mapping from action to reward
      multi_action_formatting_string: a format string for a multi-item action,
        where {item} and {price} are replaced by the item and price strings.
      buyer: the buyer agent
      seller: the seller agent
      resolution_scene: on which scene type should this component be updated
        after the event, i.e. when to check the joint action and compute results
      acting_player_names: sequence of names of players who act each stage
      outcome_summarization_fn: function of joint actions and rewards which
        returns an outcome description message for each player
      clock_now: Function to call to get current time.
      name: name of this component e.g. Possessions, Account, Property, etc
      verbose: whether to print the full update chain of thought or not
    
concordia/contrib/components/game_master/deprecated/bargain_payoffs_multi_item.py