Guest User

Untitled

a guest
Oct 22nd, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. if all((state in state_samples) for _, state in move_states):
  2. log_total_samples = math.log(sum(state_samples[s] for s in move_states.values()))
  3. move, state = max(move_states,
  4. key=lambda _, s:upper_confidence_bounds(state_results[s],state_samples[s], log_total_samples))
  5. else:
  6. move = random.choice(list(move_states.keys()))
Add Comment
Please, Sign In to add comment