class_docstr: ## [History](../index.html#History)
  
  This defines when a game ends, calculates the utility and sample chance events (dealing cards).
  
  The history is stored in a string:
  
  * First two characters are the cards dealt to player 1 and player 2
  * The third character is the action by the first player
  * Fourth character is the action by the second player
docstr: Get the terminal utility for player $i$
docstr_tok: ["Get","the","terminal","utility","for","player","$","i","$"]
code: def terminal_utility(self, i: Player) -> float:
      """
      Get the terminal utility for player $i$
      """
      # If $i$ is Player 1
      if i == PLAYERS[0]:
          return self._terminal_utility_p1()
      # Otherwise, $u_2(z) = -u_1(z)$
      else:
          return -1 * self._terminal_utility_p1()
  
imports: from typing import List, cast, Dict
  import numpy
  from labml import experiment
  from labml.configs import option
  from labml_nn.cfr import History, InfoSet, Action, Player, CFRConfigs
  from labml_nn.cfr.infoset_saver import InfoSetSaver
label_desc: Use image node_id 4 for calling the History obj's underlying member method code with example usage: obj.terminal_utility(i) and returns: self, unknown