Edit python_skeleton/player.py
python -m venv .venv
source .venv/bin/activate
pip install -r ./engine/requirements.txt
pip install -r ./python_skeleton/requirements.txt
python run.py
(Requires docker installed):
Linux
Mac
Brew: brew cask install docker
Windows
./scripts/run_docker.sh
https://cmu-poker-ai-2024.streamlit.app/
Make sure you have the environment set up as in the previous section.
python -m venv .venv
source .venv/bin/activate
pip install -r ./engine/requirements.txt
pip install -r ./python_skeleton/requirements.txt
Then install streamlit, pillow
pip install streamlit==1.32.2
pip install pillow==10.2.0
streamlit run visualize.py
If you ever use any additional packages, be sure to regenerate requirements.txt
like so:
pip freeze > python_skeleton/requirements.txt
Refer to test_gym_env.py
and engine/gym_env.py
for more details.
from engine.gym_env import PokerEnv
env = PokerEnv(num_rounds=1000)
(obs1, obs2), info = env.reset()
bot1, bot2 = random_bot, random_bot
done = False
while not done:
if obs1["is_my_turn"]:
action = bot1(obs1)
else:
action = bot2(obs2)
(obs1, obs2), (reward1, reward2), done, trunc, info = env.step(action)
env = PokerEnv(num_rounds=10, opp_bot=random_bot)
(obs1, obs2) = env.reset()
bot = random_bot
done = False
while not done:
action = bot(obs)
obs, reward, done, trunc, info = env.step(action)