Catalog PyPI
Back to packageRELEASE DETAILS

0.1.1

PyPI

7Wonder-RL-Lib

Gymnasium Environment for the game Seven Wonders

Published11 May 2023
Direct dependencies9
Transitive dependenciesNot calculated

README

Version 0.1.1 documentation

7Wonder-RL-Lib

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

GitHub GitHub issues

codecov CodeQL Build + CodeCov + Pylint/Black PyPI GitHub Pages

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

make develop
make build 
make install

Usage

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)))

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 9

Native requirements
9 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
gymnasium
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
gymnasiumruntime
black
Environment
{
  "extras": "",
  "marker": "extra == 'develop'",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
black (>=22) ; extra == 'develop'runtime
bump2version
Environment
{
  "extras": "",
  "marker": "extra == 'develop'",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
bump2version (>=1.0.0) ; extra == 'develop'runtime
check-manifest
Environment
{
  "extras": "",
  "marker": "extra == 'develop'",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
check-manifest ; extra == 'develop'runtime
pylint
Environment
{
  "extras": "",
  "marker": "extra == 'develop'",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
pylint ; extra == 'develop'runtime
mypy
Environment
{
  "extras": "",
  "marker": "extra == 'develop'",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
mypy ; extra == 'develop'runtime
twine
Environment
{
  "extras": "",
  "marker": "extra == 'develop'",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
twine ; extra == 'develop'runtime
wheel
Environment
{
  "extras": "",
  "marker": "extra == 'develop'",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
wheel ; extra == 'develop'runtime
coverage
Environment
{
  "extras": "",
  "marker": "extra == 'develop'",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
coverage ; extra == 'develop'runtime

Distribution files

2 collected
7Wonder_RL_Lib-0.1.1-py3-none-any.whl

bdist_wheel · 347.93 KB · Python py3

Source file
7Wonder-RL-Lib-0.1.1.tar.gz

sdist · 5,842.33 KB · Python source

Source file

Repository

PENDING
mirrorcraze/7wonder-rl-lib

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 16:10 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:e7f957a42bcf4a76ad8d36034b9248a5c1df6f3a02885ba1bb5f8dffaa53e3d6

Other collected versions

View all collected versions →