import random
import numpy as np
from rlcard.agents.best_response_agent import BRAgent
from copy import deepcopy


def exploitability(env, agent):
    state, player_id = env.init_game()
    num_players = env.player_num
    if num_players != 2:
        raise "Not two-players game"

    agents_1 = [BRAgent(env, agent), agent]
    agents_2 = [agent, BRAgent(env, agent)]
    env.set_agents(agents_1)
    value_sum = 0
    val1 = agents_1[0].value(player_id, state, 0)

    env.set_agents(agents_2)
    val2 = agents_2[1].value(player_id, state, 1)
    print("Val:", val1, val2)
    print("-----------------")
