Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
2c65b20
disabled counting factor by default for more realistic evaluation of …
JoelNiklaus Nov 14, 2018
8253e30
analyzed code and added docstring
JoelNiklaus Nov 14, 2018
1f9752f
renamed method for clarity
JoelNiklaus Nov 14, 2018
86ad726
decreased number of tournaments in testing so that the test time can …
JoelNiklaus Nov 14, 2018
a0d7f28
added method which resets the points of the teams in the game. this c…
JoelNiklaus Nov 14, 2018
5ae9179
added instance variable to game telling when the game is finished
JoelNiklaus Nov 15, 2018
814ca8c
implemented the possibility to seed the random generator responsible …
JoelNiklaus Nov 15, 2018
a03b2bf
seeded the test tournaments
JoelNiklaus Nov 15, 2018
446e884
made seeding possible for players too
JoelNiklaus Nov 15, 2018
4e05124
moved benchmark-like tests to benchmark folder inside tests and renam…
JoelNiklaus Nov 15, 2018
5157963
renamed project from pyschieber to schieber so it can be published on…
JoelNiklaus Nov 15, 2018
61f628a
updated the README and added a release script
JoelNiklaus Nov 16, 2018
d033fbe
updated travis.yml as a test
JoelNiklaus Nov 16, 2018
8040236
updated test failing when there was a match
JoelNiklaus Nov 16, 2018
0d9143d
added is_over to game state
JoelNiklaus Nov 24, 2018
1999e41
added external player which can be used to solve the problem of the c…
JoelNiklaus Nov 24, 2018
c524a32
refactored
JoelNiklaus Nov 24, 2018
38fe00a
added possibility to convert tuple to card and vice versa
JoelNiklaus Nov 24, 2018
7c3c86d
added cards of the current player to the observation
JoelNiklaus Nov 25, 2018
0de78aa
removed is_over from game
JoelNiklaus Nov 25, 2018
f794056
fixed some logging errors
JoelNiklaus Nov 25, 2018
0a28aa0
added conversion methods involving index which can be used in the gym…
JoelNiklaus Nov 26, 2018
5b38c9e
enabled setting of card and getting of observation directly, without …
JoelNiklaus Dec 2, 2018
e5e99a0
made all players choose OBE_ABE as a trumpf for easier experimenting …
JoelNiklaus Dec 2, 2018
4710bb1
added small bugfix
JoelNiklaus Dec 2, 2018
d8bccef
removed websockets code which is not needed anymore
JoelNiklaus Dec 2, 2018
306bfed
added extension to checking of allowed cards so it can be checked for…
JoelNiklaus Dec 3, 2018
3bca32b
added play endless in game which could be used for training RL players
JoelNiklaus Dec 5, 2018
25f6f83
performed some cleanup and added documentation
JoelNiklaus Dec 5, 2018
ac53785
hopefully made chosing of card more stable
JoelNiklaus Dec 5, 2018
fd85170
added timeout for wait, this may make the environment run through on …
JoelNiklaus Dec 5, 2018
b6927c4
added reset before playing the next game in endless play, added flag …
JoelNiklaus Dec 5, 2018
1f306df
added method to stop endless play gracefully using a condition and a …
JoelNiklaus Dec 5, 2018
9d5e0e9
added some timeout in the endless play to account for missing reset s…
JoelNiklaus Dec 5, 2018
0af9c54
added debug log for when timeout occurs
JoelNiklaus Dec 5, 2018
733a0c8
added possibility to encode card in one-hot encoding
JoelNiklaus Dec 18, 2018
bbd8b70
removed wait flag in get_observation()
JoelNiklaus Dec 21, 2018
49b874e
added a test for the external player
JoelNiklaus Dec 21, 2018
ada71b5
added model player used for evaluating the strength of an rl model
JoelNiklaus Jan 13, 2019
b4d35e5
added a sample model for testing
JoelNiklaus Jan 13, 2019
4cf43e4
renamed benchmark tests and performed some minor improvements
JoelNiklaus Jan 13, 2019
789c7f3
added support for trump restriction
JoelNiklaus Jan 13, 2019
a84f082
renamed names in benchmark for better understanding
JoelNiklaus Jan 13, 2019
29ef6de
fixed small bug
JoelNiklaus Jan 13, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ ENV/
# mypy
.mypy_cache/

#pytest
# pytest
.pytest_cache
.idea/
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ deploy:
on:
branch: master
python: '3.6'
# tags: true # only deploys it when the commit is tagged
skip_existing: true
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2017 Samuel Kurath
Copyright (c) 2018 Joel Niklaus

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
49 changes: 25 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
[![Build Status](https://travis-ci.org/Murthy10/pyschieber.svg?branch=master)](https://travis-ci.org/Murthy10/pyschieber)
[![Build Status](https://travis-ci.org/JoelNiklaus/schieber.svg?branch=master)](https://travis-ci.org/JoelNiklaus/schieber)
<a href="url"><img src="/docs/images/jasskarten.gif" align="right" width="300" ></a>
# pyschieber
Pyschieber is an implementation of the well known Swiss Schieber Jass game.
# schieber
Schieber is an implementation of the well known Swiss Schieber Jass game.

As OpenAI Gym provides APIs for several popular games to learn your algorithms master these games.
Pyschieber aims to offer an API in the same manner.
Schieber aims to offer an API in the same manner.



## Usage
To install pyschieber, simply:
To install schieber, simply:
```bash
pip install pyschieber
pip install schieber

```
pyschieber officially supports Python 3.4, 3.5, 3.6, 3.7, 3.5-dev, 3.6-dev, 3.7-dev, nightly and PyPy3.
schieber officially supports Python 3.4, 3.5, 3.6, 3.7, 3.5-dev, 3.6-dev, 3.7-dev, nightly and PyPy3.

### CLI :computer:
Beside of the API, pyschieber provides a CLI client to play the funny Scheiber Jass game.
Beside of the API, schieber provides a CLI client to play the funny Scheiber Jass game.
Currently your opponent will be a bot choosing a random card.

After the pip installation you could run the ```pyschieber``` command on the console to play a game:
After the pip installation you could run the ```schieber``` command on the console to play a game:
```bash
$ pyschieber
$ schieber
Tournament starts, the goal are 1500 points.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Round 1 starts.
Expand Down Expand Up @@ -56,34 +56,34 @@ Please chose the trumpf by the number from 0 to 6:

### Jass Challenge
The usage of a CLI to play Schieber Jass could be boring.
Therefore pyschieber provides a wrapper for your bots to play on the Zühlke Jass Server.
Therefore schieber provides a wrapper for your bots to play on the Zühlke Jass Server.

The [ServerPlayer](pyschieber/player/server_player/server_player.py) takes a pyschieber conform player
An example how to launch is provide under [Server Launcher](pyschieber/example/server_launcher.py).
The [ServerPlayer](schieber/player/server_player/server_player.py) takes a schieber conform player
An example how to launch is provide under [Server Launcher](schieber/example/server_launcher.py).

For further information have a look at:
* https://github.com/webplatformz/challenge
* https://github.com/jakeret/elbotto

## API :clipboard:
The idea of pyschieber is to extend the game with your own implemented player.
Henc schieber provides entry points to fulfill this requirement.
The idea of schieber is to extend the game with your own implemented player.
Hence schieber provides entry points to fulfill this requirement.

## Environemnt introduction
To get a first feeling for the pyschieber playground let's have a look at a runable example.
## Environment introduction
To get a first feeling for the schieber playground let's have a look at a runable example.


1. The first thing you have to do, is to instantiate a new Tournament.
```python
from pyschieber.tournament import Tournament
from schieber.tournament import Tournament

tournament = Tournament(point_limit=1500)
```

2. Add the players to your tournament. In our example we use the erratic RandomPlayers Tick, Trick, Track and the GreedyPlayer Dagobert.
```python
from pyschieber.player.random_player import RandomPlayer
from pyschieber.player.greedy_player.greedy_player import GreedyPlayer
from schieber.player.random_player import RandomPlayer
from schieber.player.greedy_player.greedy_player import GreedyPlayer


players = [RandomPlayer(name='Tick'), RandomPlayer(name='Trick'),
Expand Down Expand Up @@ -117,8 +117,8 @@ To get more familiar with this concept let's have a look at the already mentione
```python
import random

from pyschieber.player.base_player import BasePlayer
from pyschieber.trumpf import Trumpf
from schieber.player.base_player import BasePlayer
from schieber.trumpf import Trumpf


class RandomPlayer(BasePlayer):
Expand All @@ -142,11 +142,12 @@ What's going on here?
The Random Player is pretty naive and he simply chooses randomly a card or a trumpf from the list of choices.
If the turn is not allowed he randomly chooses a new one until the rules of Schieber are satisfied.

Other player examples are the [GreedyPlayer](pyschieber/player/greedy_player/greedy_player.py) or the [CliPlayer](pyschieber/player/cli_player.py).
Other player examples are the [GreedyPlayer](schieber/player/greedy_player/greedy_player.py) or the [CliPlayer](schieber/player/cli_player.py).

Now you should be ready to get your hands dirty to implement your own player and beat the random players Tick, Trick and Track! :trophy:

## Enhancements
* Add Wiesen to the game
* Beautify the CLI :trollface:
* Provide a simple network player
* Provide a simple network player
* Implement Matschbonus!
14 changes: 7 additions & 7 deletions bin/pyschieber → bin/schieber
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import sys, signal, argparse, logging

from pyschieber.player.cli_player import CliPlayer
from pyschieber.player.challenge_player.challenge_player import ChallengePlayer
from pyschieber.player.greedy_player.greedy_player import GreedyPlayer
from pyschieber.player.random_player import RandomPlayer
from pyschieber.tournament import Tournament
from schieber.player.cli_player import CliPlayer
from schieber.player.challenge_player.challenge_player import ChallengePlayer
from schieber.player.greedy_player.greedy_player import GreedyPlayer
from schieber.player.random_player import RandomPlayer
from schieber.tournament import Tournament


def parse_player_choice(player_choice=1, name_suffix=''):
Expand Down Expand Up @@ -36,14 +36,14 @@ def set_logging():


def handler(signum, frame):
print('\n pyschieber terminated! Goodbye!')
print('\n schieber terminated! Goodbye!')
sys.exit(0)


if __name__ == "__main__":
set_logging()
signal.signal(signal.SIGINT, handler)
parser = argparse.ArgumentParser(description='CLI pyschieber', )
parser = argparse.ArgumentParser(description='CLI schieber', )
parser.add_argument('-p', '--points', dest='points', type=int, help='Tournament points')
parser.add_argument('-f', '--first_opponent', dest='first_opponent', type=int,
help='Chose your first opponent. (1: Random player, 2: Greedy player, 3: Challenge player)')
Expand Down
58 changes: 0 additions & 58 deletions pyschieber/card.py

This file was deleted.

16 changes: 0 additions & 16 deletions pyschieber/dealer.py

This file was deleted.

110 changes: 0 additions & 110 deletions pyschieber/game.py

This file was deleted.

39 changes: 0 additions & 39 deletions pyschieber/player/base_player.py

This file was deleted.

Loading