def give_action_choose_probability_new(episodes, episode, model):
    """
    This method gives probability of choosing action according to the episode number and total number of episode.
    :param episodes: total number of episodes
    :param episode: current running episode
    :param model: model number
    :return: probability
    """
    if model == 0:
        # pure qvalue defined model, no randomness
        return 0
    if model == 1:
        # pure random model.
        return 1
    if model == 2:
        # if episode<40% random else not random
        threshold = int(episodes * 0.4)
        if episode < threshold:
            return 1
        else:
            return 0
    if model == 3:
        # if episode<40% random, if between 40 to 50 0.8, if 50 to 70, 0.5, if between 70 to 85 0.3, if between 85 to 100 0
        threshold0 = int(episodes * 0.6)
        threshold1 = int(episodes * 0.8)
        threshold2 = int(episodes * 0.9)
        # threshold3 = int(episodes * 0.85)
        threshold4 = int(episodes * 0.99)
        threshold5 = int(episodes * 1)
        if episode < threshold0:
            return 1
        elif episode < threshold1:
            return 0.8
        elif episode < threshold2:
            return 0.5
        # elif episode < threshold3:
        #    return 0.3
        elif episode < threshold4:
            return 0.15
        else:
            return 0