7Wonder-RL-Lib
Library providing environment for testing Reinforcement learning in 7 Wonders Game.
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)))
Metadata
Release files for 7Wonder-RL-Lib 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| 7Wonder-RL-Lib-0.1.1.tar.gz | 6.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 7Wonder_RL_Lib-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.3 MB
Release files / 7Wonder-RL-Lib-0.1.1.tar.gz
| Download URL | 7Wonder-RL-Lib-0.1.1.tar.gz |
|---|---|
| Size | 6.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea47870349f158648b051a698bbe434e661322e183c3e2312978848a308e8b9a
|
|
BLAKE2b-256 checksum How to use checksums |
24bb6a213194d5f06522203c7617e9c4c53580f91add432ca4dc457507761a57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / 7Wonder_RL_Lib-0.1.1-py3-none-any.whl
| Download URL | 7Wonder_RL_Lib-0.1.1-py3-none-any.whl |
|---|---|
| Size | 356.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
75bf772ee5d84eac831d5391b65c42b0619efff6c3c2ec0e7c1a1d5f5ff1ccf0
|
|
BLAKE2b-256 checksum How to use checksums |
796fba6e0e4268ddccc28792d9ef4a239541683e22d51f1036ca428bd427ca1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|