Skip to main content

7Wonder-RL-Lib

Library providing environment for testing Reinforcement learning in 7 Wonders Game.

GitHub GitHub issues

codecov CodeQL Build + CodeCov + Pylint/Black

Overview

There are multiple environments for the AI game testing. However, environments implemented now are mostly covered only the traditional board games (Go, Chess, etc.) or 52-card based card games (Poker, Rummy, etc.) where games do not really have interactions with other players.

Most of the Euro-games board games are good game environments to test the algorithm on as there are many aspects to explore, such as tradings, dealing with imperfect informations, stochastic elements, etc.

7 Wonders board games introduced multiple elements mentioned above which are good for testing out new algorithm. This library will cover basic game systems and allow users to customize the environments with custom state space and rewarding systems.

Installation

To install the gym environment, run pip install -e SevenWondersEnv Example codes of how to declare the gym environment is displayed below

import SevenWonEnv
from SevenWonEnv.envs.mainGameEnv import Personality 

env = gym.make("SevenWonderEnv", player=4) #Declare Environment with 4 Players

To use the Personality that is given (RandomAI, RuleBasedAI, DQNAI, Human), use setPersonality(personalityList)

personalityList = []
    personalityList.append(Personality.DQNAI)
    for i in range(1, 4):
        personalityList.append(Personality.RandomAI)
    env.setPersonality(personalityList)

To run the game each step,

stateList = env.step(None)

The variable stateList consist of n 4-tuple, depends on number of players. Each tuple are (new_state, reward, done, info).

To add the custom model, change the SevenWondersEnv/SevenWonEnv/envs/mainGameEnv/Personality.py file. Each personality will have 2 main functions, which are init and make_choice.

For example, RandomAI takes all possible choices and randomly choose one choice.

class RandomAI(Personality):
    def __init__(self):
        super().__init__()

    def make_choice(self, player, age, options):
        return random.choice(range(len(options)))

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

7Wonder-RL-Lib-0.1.0.tar.gz (361.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

7Wonder_RL_Lib-0.1.0-py3-none-any.whl (355.9 kB view details)

Uploaded Python 3

File details

Details for the file 7Wonder-RL-Lib-0.1.0.tar.gz.

File metadata

  • Download URL: 7Wonder-RL-Lib-0.1.0.tar.gz
  • Upload date:
  • Size: 361.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for 7Wonder-RL-Lib-0.1.0.tar.gz
Algorithm Hash digest
SHA256 df2fedf8673964c0e75197ecda00c49ff7289e50c66d08ce2d928e37b46ee7b9
MD5 25197c4cadabe7ff398ee014075a1b1e
BLAKE2b-256 b16eb4dc3e6d41444f3e7f47c091e6209f7c4492b9821f88a42c3b8fdb7755f7

See more details on using hashes here.

File details

Details for the file 7Wonder_RL_Lib-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: 7Wonder_RL_Lib-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 355.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for 7Wonder_RL_Lib-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 99b2df7f4becb7e588f29ae215df984ed17229ad527591f1195efdad95ef1894
MD5 866cba07f7ea4890733f84a5b866e7e1
BLAKE2b-256 99af70284c2966bb62b452d5f047599a22b7dca8f6c67debe8259b887575193e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page