Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if all((state in state_samples) for _, state in move_states):
- log_total_samples = math.log(sum(state_samples[s] for s in move_states.values()))
- move, state = max(move_states,
- key=lambda _, s:upper_confidence_bounds(state_results[s],state_samples[s], log_total_samples))
- else:
- move = random.choice(list(move_states.keys()))
Add Comment
Please, Sign In to add comment