Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. def backup(self, value_estimate: float):
  2. current = self
  3. while current.parent is not None:
  4. current.number_visits += 1
  5. if current.game.player == 1: # same as current.parent.game.player = 0
  6. current.total_value += (1*value_estimate) # value estimate +1 = O wins
  7. elif current.game.player == 0: # same as current.parent.game.player = 1
  8. current.total_value += (-1*value_estimate)
  9. current = current.parent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement