All Projects → zmcx16 → OpenAI-Gym-Hearts

zmcx16 / OpenAI-Gym-Hearts

Licence: MIT license
OpenAI Gym Hearts Card Game

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to OpenAI-Gym-Hearts

Stable Baselines
Mirror of Stable-Baselines: a fork of OpenAI Baselines, implementations of reinforcement learning algorithms
Stars: ✭ 115 (+447.62%)
Mutual labels:  openai-gym
Gym Fx
Forex trading simulator environment for OpenAI Gym, observations contain the order status, performance and timeseries loaded from a CSV file containing rates and indicators. Work In Progress
Stars: ✭ 151 (+619.05%)
Mutual labels:  openai-gym
Ns3 Gym
ns3-gym - The Playground for Reinforcement Learning in Networking Research
Stars: ✭ 221 (+952.38%)
Mutual labels:  openai-gym
Reinforcementlearning Atarigame
Pytorch LSTM RNN for reinforcement learning to play Atari games from OpenAI Universe. We also use Google Deep Mind's Asynchronous Advantage Actor-Critic (A3C) Algorithm. This is much superior and efficient than DQN and obsoletes it. Can play on many games
Stars: ✭ 118 (+461.9%)
Mutual labels:  openai-gym
Holdem
🃏 OpenAI Gym No Limit Texas Hold 'em Environment for Reinforcement Learning
Stars: ✭ 135 (+542.86%)
Mutual labels:  openai-gym
Tensorflow Rl
Implementations of deep RL papers and random experimentation
Stars: ✭ 176 (+738.1%)
Mutual labels:  openai-gym
Cartpole
OpenAI's cartpole env solver.
Stars: ✭ 107 (+409.52%)
Mutual labels:  openai-gym
awesome-isaac-gym
A curated list of awesome NVIDIA Issac Gym frameworks, papers, software, and resources
Stars: ✭ 373 (+1676.19%)
Mutual labels:  openai-gym
Finrl Library
FinRL: Financial Reinforcement Learning Framework. Please star. 🔥
Stars: ✭ 3,037 (+14361.9%)
Mutual labels:  openai-gym
Gymfc
A universal flight control tuning framework
Stars: ✭ 210 (+900%)
Mutual labels:  openai-gym
Drqn Tensorflow
Deep recurrent Q Learning using Tensorflow, openai/gym and openai/retro
Stars: ✭ 127 (+504.76%)
Mutual labels:  openai-gym
Ravens
Train robotic agents to learn pick and place with deep learning for vision-based manipulation in PyBullet. Transporter Nets, CoRL 2020.
Stars: ✭ 133 (+533.33%)
Mutual labels:  openai-gym
Hands On Intelligent Agents With Openai Gym
Code for Hands On Intelligent Agents with OpenAI Gym book to get started and learn to build deep reinforcement learning agents using PyTorch
Stars: ✭ 189 (+800%)
Mutual labels:  openai-gym
Hierarchical Actor Critic Hac Pytorch
PyTorch implementation of Hierarchical Actor Critic (HAC) for OpenAI gym environments
Stars: ✭ 116 (+452.38%)
Mutual labels:  openai-gym
A3c continuous
A continuous action space version of A3C LSTM in pytorch plus A3G design
Stars: ✭ 223 (+961.9%)
Mutual labels:  openai-gym
Ctc Executioner
Master Thesis: Limit order placement with Reinforcement Learning
Stars: ✭ 112 (+433.33%)
Mutual labels:  openai-gym
Coach
Reinforcement Learning Coach by Intel AI Lab enables easy experimentation with state of the art Reinforcement Learning algorithms
Stars: ✭ 2,085 (+9828.57%)
Mutual labels:  openai-gym
yarll
Combining deep learning and reinforcement learning.
Stars: ✭ 84 (+300%)
Mutual labels:  openai-gym
Ma Gym
A collection of multi agent environments based on OpenAI gym.
Stars: ✭ 226 (+976.19%)
Mutual labels:  openai-gym
Deep Reinforcement Learning Gym
Deep reinforcement learning model implementation in Tensorflow + OpenAI gym
Stars: ✭ 200 (+852.38%)
Mutual labels:  openai-gym

OpenAI Gym Hearts Card Game

Codacy Badge

  • Implement an OpenAI Gym Hearts Card Game simulation environment, easy to collect game data to use it in Machine Learning and Reinforcement Learning, the main game logic is fork from https://github.com/danielcorin/Hearts.

Requirement

pip install gym

Demo

python run_example.py

Support Agent

  • Human
  • Random

Scoring

  • Queen card is 1 penalty point, Queen of Spades is 13 penalty points.
  • Shooting the moon: If one player takes all the penalty cards on one deal, that player's score remains unchanged while 26 penalty points are added to the scores of each of the other players.

Game Flow

  1. env.reset() -> Start Hearts game, env send the GameStart event to all player.
  2. env send NewRound event to all player.
  3. env send PassCards event to each player, the player need choose 3 cards to pass other player and send PassCards_Action event to env.
  4. After all players send legal PassCards_Action event, env will send ShowPlayerHand event to each player to get the final hand cards.
  5. env send PlayTrick event to the player, the player choose a card and send PlayTrick_Action event to env.
  6. env will send ShowTrickAction event to all players to tell them the player's action.
  7. After all players take a card, env will send ShowTrickEnd event to tell the players that which one win this trick.
  8. After last trick, env will send RoundEnd event to announce which player win this round, if the loser's score > max_score, env send GameOver event to all players and exit the game, or send NewRound event to all players to continue game.

API

  • GameStart
{
    "event_name" : "GameStart",
    "broadcast" : True,
    "data" : {
        "players" : [
            {'playerName': 'Kazuma'},
            {'playerName': 'Aqua'},
            {'playerName': 'Megumin'},
            {'playerName': 'Darkness'}
        ]
    }

}
  • NewRound
{
    "event_name" : "NewRound",
    "broadcast" : True,
    "data" : {
        "players" : [
            {'playerName': 'Kazuma'
            ,'score': 0},
            {'playerName': 'Aqua'
            ,'score': 0},
            {'playerName': 'Megumin'
            ,'score': 0},
            {'playerName': 'Darkness'
            ,'score': 0}
        ]
    }
}
  • PassCards
{
    "event_name" : "PassCards",
    "broadcast" : False,
    "data" : {
        'playerName': 'Kazuma', 
        'hand': ['6c', '2d', '3d', '6d', '7d', 'Jd', 'Qd', '3s', '3h', '6h', 'Qh', 'Kh', 'Ah']
    }
}
  • PassCards_Action
{
    "event_name" : "PassCards_Action",
    "data" : {
        'playerName': 'Kazuma', 
        'action': {'passCards': ['6c', '2d', '3d']}
    }
}
  • ShowPlayerHand
{
    "event_name" : "ShowPlayerHand",
    "broadcast" : Fasle,
    "data" : {
        'playerName': 'Kazuma', 
        'hand': ['Ac', '6d', '7d', '9d', 'Jd', 'Qd', '3s', '3h', '6h', 'Jh', 'Qh', 'Kh', 'Ah']
    }
}
  • PlayTrick
{
    "event_name" : "PlayTrick",
    "broadcast" : False,
    "data" : {
        'playerName': 'Kazuma', 
        'hand': ['7d', '9d', 'Jd', 'Qd', '3s', '3h', '6h', 'Jh', 'Qh', 'Kh', 'Ah'],
        'trickNum': 3,
        'trickSuit': 's',               //first player this value = "Unset"
        'currentTrick': [
            {'playerName': 'Megumin'
            ,'card': '9s'},
            {'playerName': 'Darkness'
            ,'card': '7s'}
		],
		'IsHeartsBroken': False
    }

}
  • PlayTrick_Action
{
    "event_name" : "PlayTrick_Action",
    "data" : {
        'playerName': 'Kazuma', 
        'action': {'card': '3s'}
    }
}
  • ShowTrickAction
{
    "event_name" : "ShowTrickAction",
    "broadcast" : True,
    "data" : {
        'trickNum': 3,
        'trickSuit': 'c',
        'currentTrick': [
            {'playerName': 'Kazuma'
            ,'card': '3s'},
            {'playerName': 'Megumin'
            ,'card': '9s'},
            {'playerName': 'Darkness'
            ,'card': '7s'}
		],
        'IsHeartsBroken': False
    }
}
  • ShowTrickEnd
{
    "event_name" : "ShowTrickEnd",
    "broadcast" : True,
    "data" : {
        'trickNum': 3,
        'trickWinner': 'Megumin',
        'cards': ['3s', '2s', '9s', '7s'],
		'IsHeartsBroken': False
    }
}
  • RoundEnd
{
    "event_name" : "RoundEnd",
    "broadcast" : True,
    "data" : {
        "players" : [
            {'playerName': 'Kazuma'
            ,'score': 10},
            {'playerName': 'Aqua'
            ,'score': 13},
            {'playerName': 'Megumin'
            ,'score': 3},
            {'playerName': 'Darkness'
            ,'score': 0}
        ],
		'ShootingMoon': False,
        'Round': 3
    }
}
  • GameOver
{
    "event_name" : "GameOver",
    "broadcast" : True,
    "data" : {
        "players" : [
            {'playerName': 'Kazuma'
            ,'score': 0},
            {'playerName': 'Aqua'
            ,'score': 120},
            {'playerName': 'Megumin'
            ,'score': 36},
            {'playerName': 'Darkness'
            ,'score': 26}
        ],
        'Round': 7,
        'Winner': 'Kazuma'
    }
}

Reference

License

This project is licensed under the terms of the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].