def outcome_summary_fn(
    unused_binary_joint_action: Mapping[str, int],
    joint_action: Mapping[str, str],
    rewards: Mapping[str, float],
    cumulative_rewards: Mapping[str, float],
) -> Mapping[str, str]:
  """Summarize the outcome of a decision scene."""
  result = {}
  mean_score = np.mean(list(rewards.values()))
  mean_cumulative_score = np.mean(list(cumulative_rewards.values()))
  for name, score in rewards.items():
    choice = joint_action[name]
    cumulative_score = cumulative_rewards[name]
    reward_comparative = _get_comparative(score, mean_score)
    cumulative_comparative = _get_comparative(
        cumulative_score, mean_cumulative_score
    )
    result[name] = (
        f'[minigame round outcome] {name} chose "{choice}" and got a score of '
        f'{score:.3g}, which was {reward_comparative} the average score of '
        f'{mean_score:.3g}. Cumulatively, {name} currently has a total score '
        f'of {cumulative_score:.3g}, which is {cumulative_comparative} the '
        f'average cumulative score of {mean_cumulative_score:.3g}.'
    )
  return result
Summarize the outcome of a decision scene.
examples/deprecated/modular/environment/reality_show.py