<reponame>davidbrown3/reinforcement-learning<filename>MC/SampleBJPolicy.py<gh_stars>1-10
import numpy as np

def sample_policy(observation):
    """
    A policy that sticks if the player score is >= 20 and hits otherwise.
    """
    score, dealer_score, usable_ace = observation
    return 0 if score >= 20 else 1
import numpy as np

def sample_policy(observation):
    """
    A policy that sticks if the player score is >= 20 and hits otherwise.
    """
    score, dealer_score, usable_ace = observation
    return 0 if score >= 20 else 1
A policy that sticks if the player score is >= 20 and hits otherwise.