Skip to content

Commit 2cec620

Browse files
author
wangfuming
committed
📝 modify readme add gui part
1 parent ef809f1 commit 2cec620

5 files changed

Lines changed: 74 additions & 10 deletions

File tree

README.md

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ A open sourced, efficient Texas Hold'em and short deck solver. See this [Introdu
1212

1313
![algs](img/solvergui.gif)
1414

15-
This is a java-based Texas Hold'em solver, fully open source, supports cross-language calls (supports python and command-line calls by default). Support standard Texas Hold'em and it's popular variant short-deck.
15+
This is a java-based Texas Hold'em solver, fully open source, have a pio-solver-like gui and supports cross-language calls (supports python and command-line calls by default). Support standard Texas Hold'em and it's popular variant short-deck.
1616

17-
Similar to common commercial Texas Hold'ems solvers such as piosolver, TexasHoldemSolverJava focusing on solving post-flop situations, and it's result is prefectly aligned with piosolver. On turn and river it's speed is even faster than piosolver, but on flop is slower than piosolver.
17+
Similar to common commercial Texas Hold'ems solvers such as piosolver, TexasHoldemSolverJava focusing on solving post-flop situations, and it's result is aligned with piosolver. On ~~turn and~~ river it's speed is even faster than piosolver, but on flop is slower than piosolver.
1818

1919
Features:
2020

2121
- Efficient, ~~turn and~~ river calculation speed exceeds piosolver
2222
- Accurate, the results are almost the same as piosolver
2323
- Fully open source and free
24+
- Have a simple gui
2425
- Support standard Texas Hold'em and it's popular variant short-deck
2526
- Focus on post-flop situations
2627
- Supports command line and python calls
@@ -32,7 +33,9 @@ This project is suitable for:
3233

3334
## install
3435

35-
download the [release package](https://github.com/bupticybee/TexasHoldemSolverJava/releases) unzip it, you will get a folder look like this:
36+
Install x86 [Java Runtime Environment](https://www.oracle.com/java/technologies/javase-jre8-downloads.html) first.
37+
38+
Download the [release package](https://github.com/bupticybee/TexasHoldemSolverJava/releases) unzip it, you will get a folder look like this:
3639

3740
```
3841
--- Solver
@@ -42,6 +45,8 @@ download the [release package](https://github.com/bupticybee/TexasHoldemSolverJa
4245
|- riversolver.sh
4346
```
4447

48+
Install is done. It's that simple.
49+
4550
```RiverSolver.jar``` is the solver program file,```java_interface.py``` is the sample code for calling solver trough python calls. It contains the following test cases:
4651

4752
- testcase for short flop situation
@@ -56,6 +61,17 @@ after download the release package, run ```python3 java_interface.py``` to run a
5661

5762
In addition to downloading the software itself, Texas Holdem solver Java also relies on JRE 11.0.2 as it's e runtime. Please install Java JRE 11.0.2 in advance.
5863

64+
65+
## Usage
66+
67+
### gui
68+
69+
Make sure the right version of java is installed in your computer(64bit,java 10.x / java 11.x)
70+
71+
Double click the ```riversolver.jar``` to open gui.
72+
73+
### python api
74+
5975
Additional python requirements should also be installed through pip:
6076

6177
```bash
@@ -66,9 +82,6 @@ pip3 install networkx
6682
pip3 install matplotlib
6783
```
6884

69-
## Usage
70-
### python api
71-
7285
Althrough written in java. TexasHoldemSolverJava is by default called through python.
7386

7487
Sample code involves python calls can be found in ```java_interface.py```. Here we briefly introduce the procedure of calling the solver and some basic parameters.
@@ -224,6 +237,25 @@ However if you intend to modify this project, recompiling is required. TexasHold
224237
4. press build -> build artifacts -> all artifacts -> build to generate the release package
225238
5. the release package can be found in the ```out``` folder in project root
226239

240+
## benchmarks
241+
242+
The speed compair with piosolver listed below, turn and river's speed is comparable with piosolver , flop is much slower due to game tree and lack of optimization.
243+
244+
| | flop sample | turn sample | river sample |
245+
| --------------------- | ----------- | ----------- | ------------ |
246+
| piosolver | 7.91s | 1.5s | 0.56s |
247+
| TexasHoldemSolverJava | 98s | 4.21s | 0.06s |
248+
249+
Input of the above benchmark and result compair with piosolver is listed below.
250+
251+
| | flop sample | turn sample | river sample |
252+
| -------------- | ----------- | ----------- | ------------ |
253+
| input (in text format) | [flop](benchmarks/benchmark_flop.txt) | [turn](benchmarks/benchmark_turn.txt) | [river](benchmarks/benchmark_river.txt) |
254+
| input (in image format) | ![flop](img/flop_setting.jpeg) | ![turn](img/turn_setting.jpeg) | ![river](img/river_setting.jpeg) |
255+
| result compair | ![flop](img/flop_result.jpeg) | ![turn](img/turn_result.jpeg) | ![river](img/river_result.jpeg) |
256+
257+
The slight different between Piosolver and TexasHoldemSolverJava is due to different tree construction logic and insufficient CFR converge for both software.
258+
227259
## Algorithm
228260
As shown in the figure below, thanks to the implementation of the latest algorithm variant discounted CFR ++, algorithm used in this project can be a lot faster than traditional algorithms such as CFR +.
229261
![algs](img/algs.png)

README.zh-CN.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ README [English](README.md) | [中文](README.zh-CN.md)
1111

1212
![algs](img/solvergui.gif)
1313

14-
这是一个基于java的德州扑克solver,完全开源,支持跨语言调用(默认支持python和命令行调用),实现了标准德州扑克和德州扑克的一个变种-德州扑克短牌的solver,和piosolver等常见德州扑克solver类似,重点提供翻牌后情况的求解,solver求解结果结果和piosolver完全对齐。速度上在turn和river上比piosolver快一些,但是flop比piosolver慢。
14+
这是一个基于java的德州扑克solver,完全开源,支持跨语言调用(默认支持python和命令行调用),实现了标准德州扑克和德州扑克的一个变种-德州扑克短牌的solver,和piosolver等常见德州扑克solver类似,重点提供翻牌后情况的求解,solver求解结果结果和piosolver对齐。速度上在~~turn和~~river上比piosolver快一些,但是flop比piosolver慢。
1515

1616
项目特性:
1717
- 高效,~~转牌和~~河牌计算速度超过piosolver
1818
- 准确,结果和piosolver几乎相同
1919
- 完全开源并且免费
20+
- 拥有一个简单易用的gui界面
2021
- 支持标准德州扑克和流行的变种玩法短牌
2122
- 主要聚焦在翻牌后求解
2223
- 支持命令行和python调用
@@ -27,6 +28,8 @@ README [English](README.md) | [中文](README.zh-CN.md)
2728

2829
## 安装
2930

31+
首先需要安装 x86(64位) [Java Runtime Environment](https://www.oracle.com/java/technologies/javase-jre8-downloads.html).
32+
3033
下载[release](https://github.com/bupticybee/TexasHoldemSolverJava/releases) 包,release包的结构如下:
3134

3235
```
@@ -37,6 +40,8 @@ README [English](README.md) | [中文](README.zh-CN.md)
3740
|- riversolver.sh
3841
```
3942

43+
安装就这样完成了,就是这么简单!
44+
4045
其中RiverSolver是德州扑克solver主体程序,```java_interface.py``` 是通过python调用solver的示例程序,其中的测试用例包含了
4146
- 短牌flop求解示例
4247
- 短牌turn求解示例
@@ -50,6 +55,16 @@ riversolver.sh 包含了命令行调用solver的示例
5055

5156
除了需要下载软件本身之外,TexasHoldemSolverJava 还依赖 JRE 11.0.2 作为运行库。如果电脑上没有请安装java JRE 11.0.2。
5257

58+
59+
## 使用
60+
### 图形界面
61+
62+
确认你已经安装了正确版本的java(64bit,java 10.x / java 11.x)
63+
64+
双击 ```riversolver.jar``` 打开gui.
65+
66+
### python 调用方法
67+
5368
虽然 TexasHoldemSolverJava 绝大部分逻辑代码由java撰写,但是默认提供的调用方式是python,所以需要安装额外的一些python依赖。
5469
使用python调用solver需要首先安装如下依赖:
5570

@@ -61,9 +76,6 @@ pip3 install networkx
6176
pip3 install matplotlib
6277
```
6378

64-
## 使用
65-
### python 调用方法
66-
6779
python 调用的所有代码均可在[release](https://github.com/bupticybee/TexasHoldemSolverJava/releases) 包中的 java_interface.py中找到。这里简单描述调用过程和一些参数设定。
6880

6981
撰写python代码时,首先保证rsources目录和jar文件(通过release下载)在work dir下,import 各个依赖包:
@@ -212,6 +224,26 @@ actions:
212224
4. 菜单栏 build -> build artifacts -> all artifacts -> build 生成release包
213225
5. 编译完成的release包可以在工程根目录下的out 路径中找到
214226

227+
228+
## 对照实验
229+
230+
和piosolver的速度对比实验如下,同一个牌面下turn 和river的速度和piosolver仍处于接近水平, 但是flop比piosolver慢很多,由于flop的代码尚未很好的优化.
231+
232+
| | flop sample | turn sample | river sample |
233+
| --------------------- | ----------- | ----------- | ------------ |
234+
| piosolver | 7.91s | 1.5s | 0.56s |
235+
| TexasHoldemSolverJava | 98s | 4.21s | 0.06s |
236+
237+
上面实验中的pio格式输入,和结果对比列在下面表格中,任何人均可复现:
238+
239+
| | flop sample | turn sample | river sample |
240+
| -------------- | ----------- | ----------- | ------------ |
241+
| 输入 (pio格式) | [flop](benchmarks/benchmark_flop.txt) | [turn](benchmarks/benchmark_turn.txt) | [river](benchmarks/benchmark_river.txt) |
242+
| 输入 (图片格式) | ![flop](img/flop_setting.jpeg) | ![turn](img/turn_setting.jpeg) | ![river](img/river_setting.jpeg) |
243+
| 结果对比 | ![flop](img/flop_result.jpeg) | ![turn](img/turn_result.jpeg) | ![river](img/river_result.jpeg) |
244+
245+
结果策略上和Piosolver的略微不同是由于TexasHoldemSolverJava采用了和Piosolver略微不同的游戏树构建算法,并且两个算法停止时均为完全收敛.
246+
215247
## 算法
216248
如图,得益于实现的最新算法的变种 discounted cfr++, 在算法上可以保证比cfr+等传统算法快得多的速度。
217249
![algs](img/algs.png)

0 commit comments

Comments
 (0)