Giter VIP home page Giter VIP logo

texasholdemsolverjava's Introduction

TexasHoldemSolverJava

release license

README English | 中文

🚨 This project still works but it's no longer maintained. Please check our latest C++ version TexasSolver.

Introduction

A open sourced, efficient Texas Hold'em and short deck solver. See this Introduction video for more.

algs

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.

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.

Features:

  • Efficient, turn and river calculation speed exceeds piosolver
  • Accurate, the results are almost the same as piosolver
  • Fully open source and free
  • Have a simple gui
  • Support standard Texas Hold'em and it's popular variant short-deck
  • Focus on post-flop situations
  • Supports command line and python calls

This project is suitable for:

  • high-level Texas Hold'em players
  • Scholars in the field of incomplete information games

install

Install 64bit Java Runtime Environment first.

Download the release package unzip it, you will get a folder look like this:

--- Solver
 |- resources
 |- java_interface.py
 |- RiverSolver.jar
 |- riversolver.sh

Install is done. It's that simple.

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:

  • testcase for short flop situation
  • testcase for short turn situation
  • testcase for short river situation
  • testcase for holdem turn situation
  • testcase for holdem river situation

riversolver.sh contains sample code for command line calls.

after download the release package, run python3 java_interface.py to run all the testcases.

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.

Usage

gui

Make sure the right version of java is installed in your computer(64bit,java 10.x / java 11.x)

Double click the riversolver.jar to open gui.

python api

Additional python requirements should also be installed through pip:

pip3 install jpype
pip3 install numpy
pip3 install yaml
pip3 install networkx
pip3 install matplotlib

Althrough written in java. TexasHoldemSolverJava is by default called through python.

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.

When running python codes, make sure resource folder and jar file(can be downloaded) are placed in work dir. After that import all dependencies through the code below:

from jpype import *
import yaml
import numpy as np
import sys
sys.path.append("resources")
from python.TreeBuilder import *

Next, start the JVM and load the solver class:

startJVM(getDefaultJVMPath(), "-ea", "-Djava.class.path=%s" % "./RiverSolver.jar")
PokerSolver = JClass('icybee.solver.runtime.PokerSolver')

Initialize PokerSolver class, PokerSolver is used to do the optimal strategy finding(solving) job.

ps_holdem = PokerSolver("Dic5Compairer",
    "./resources/compairer/card5_dic_sorted.txt", # Load hand compair dictionary file. Holdem and shortdeck use different dictionary file
    2598961, # valid line of dictionary file
    ['A', 'K', 'Q', 'J', 'T', '9', '8', '7', '6', '5', '4', '3'], # figure of cards
    ['h', 's', 'd', 'c'] # pattern of cards
)

Like in piosolver, when solving a specific holdem/shortdeck scenario (for example in turn), a game tree should be built first:

# Load some general rules of texas holdem. e.g. you can check/raise after a check, you can raise/call/fold after a raise.
with open('resources/yamls/general_rule.yaml') as fhdl:
    conf = yaml.load(fhdl)
# Use RulesBuilder to convert these rules to game tree.
rule = RulesBuilder(
    conf,
    current_commit = [2,2], # current bets of both players(p0 and p1)
    current_round =  3, # current round of the game, 1 for preflop, 2 for flop,3 for turn,4 for river
    raise_limit = 3, # the limit of numbers of raises
    check_limit = 2, # how many times you can check, in 2-player texas holdem, it's 2
    small_blind = 0.5, # amount of small blind (SB)
    big_blind = 1, # amount of big blind (BB)
    stack = 10, # the amount of chips for both sides. If two player have different chip amount, fill in the smaller number here. For example player1 have $100 chip and player2 have $150, fill in 100 here.
    bet_sizes = ["0.5_pot","1_pot","2_pot","all-in"], # bet sizes and raise sizes considered in the game tree,can be number e.g. 1,1.5 or in the proportion of the pot e.g. "0.5_pot","1_pot"
)
# build the game tree according to the settings above
gameTree = PartGameTreeBuilder(rule)
# save the game tree to disk
gameTree.gen_km_json("./.tree.km",limit=np.inf,ret_json=True)

Read the game tree in solver and construct the game tree in memory.

ps_holdem.build_game_tree("./.tree.km")

Input all the parameters and start solving.

result = ps_holdem.train(
    "AA:0.5,KK:0.9,QQ:0.8,97,96,87,86,76", # player1's range, seperate by ','; you can write range in two ways: (1) "KK:0.5" stands for player have K-pair weighted 0.5 (2) "KK" stands for player have a K-pair weighted 1
    "AA:0.8,KK:0.2,QQ:0.3,86,76:0.9", # player2's range
    "Kd,Jd,Td,7s", # the revealed public cards. In turn there are four. 
    50, # the iterations for cfr algorithm
    10, # the gap to print exploitability
    False, # whether to print debug info
    True, # whether to use parallel technology
    "output_strategy.json", # for to write output strategy. When set to None the strategy json will be returned in result of this method.
    "log.txt", # log file 
    "discounted_cfr", # the solver algorithm ,support "cfr" vanilla cfr algorithm, "cfr_plus" faster cfr+ algorithm,"discounted_cfr" discounted cfr ++ algorithm we proposed here
    "none", # whether to use monte coral sampling algorithm,useful when the game tree is extremely big,got two options: "none" means do not use monte coral algorithm, "public" use public chance monte coral algorithm
    -1, # threads number ,1 for single thread,2 for two threads...,-1 means use all possible cpu
    1, # action fork probability, relevant to solver multithread performance ,should be between 0~1
    1, # chance fork probability, relevant to solver multithread performance ,should be between 0~1
    1, # fork every tree depth, relevant to solver multithread performance , should be > 0
    4, # fork minimal size, relevant to solver multithread performance , should be > 0
)

The solver will start to work after executing the above code. Time required for solving is affected by game tree size, range complicity, and computer hardware. In my mac book pro, river can be solved in less than 1 second, turn can be solved usually within 10 seconds.

command line api

Please refer to code in riversolver.sh in release package. The parameters are the same to the python code.

Reading the Solver's output

When running, the solver would generate logs like this:

Iter: 0
player 0 exploitability 1.653075
player 1 exploitability 2.146374
Total exploitability 47.493111 precent
-------------------
Iter: 11
player 0 exploitability 0.040586
player 1 exploitability 0.322102
Total exploitability 4.533607 precent
-------------------
......
-------------------
Iter: 41
player 0 exploitability -0.114473
player 1 exploitability 0.168947
Total exploitability 0.680923 precent
.Using 4 threads

Be ware how the exploitability converges, normally a strategy with an exploitability < 0.5 is more than enough to serve as an optimal strategy.

An output_strategy.json file will be generated by the solver after solving. It can be read by any language and you can directly opened by firefox(yes, the famous browser). The size of the file varies between a few Kb to dozens of Gb.

If opened by firefox, you are excepted to see something looks like this:

algs

player : 1

This field indicates player1 is making his move.

actions:
    0: "CHECK"
    1: "BET 4.0"

"actions" field contains player1's moves considered by the solver.

Strategy field contains optimal strategy for player1 with different hands:

algs

Each specific item of strategy contains the "optimal strategy" of specific hand calculated by the solver.

algs

For example, the figure above represents that when player 1 gets the hand of qd7c (square Q, plum 7), the optimal strategy is to check with 34% probability and bet with 65% probability.

Compile the release package

Normally compiling the release package manually is not required. It can be directly downloaded here However if you intend to modify this project, recompiling is required. TexasHoldemSolverJava is a IDEA project, an IDEA environment is required to compile the release package, if you want to compile the release package, please follow the following instruction:

  1. install IntellIJ IDEA
  2. download TexasHoldemSolverJava from github and load to IntellIJ IDEA
  3. press build -> build project to compile the projet from source
  4. press build -> build artifacts -> all artifacts -> build to generate the release package
  5. the release package can be found in the out folder in project root

benchmarks

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.

flop sample turn sample river sample
piosolver 7.91s 1.5s 0.56s
TexasHoldemSolverJava 98s 4.21s 0.06s

Input of the above benchmark and result compair with piosolver is listed below.

flop sample turn sample river sample
input (in text format) flop turn river
input (in image format) flop turn river
result compair flop turn river

The slight different between Piosolver and TexasHoldemSolverJava is due to different tree construction logic and insufficient CFR converge for both software.

Algorithm

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 +. algs

c++ version

If you somehow feel our java version is not fast enough,here is a ported c++ version ,c++ version is faster than java version in turn and river, however still contains certain problems:

  • supports only Linux machine
  • manually compile is reqiured before use
  • c++ version's code is not well optimized, it's slower 5x faster than the java version on flop.

License

MIT © bupticybee

Contact

[email protected]

texasholdemsolverjava's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

texasholdemsolverjava's Issues

压缩包解压后直接运行jar,点击按钮报错

按照哔哩哔哩视频中解压了zip,但是直接运行jar点击按钮报错了,我的电脑是Mac,jdk是8,这个和jdk版本有关系吗,但是我在idea中启动项目(依旧是jdk8)点击按钮都没问题

java.lang.OutOfMemoryError: Java heap space

When running python3 java_interface.py after installation, I first get this warning:

java_interface.py:15: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.

Then after running a short while, I get an error. This is the complete output:

self.conf = yaml.load(fhdl)
Dic5Comapirer Load 99% │███████████████▉│ 376900/376993 (0:00:01 / 0:00:00)
Dic5Comapirer Load 99% │█████████████▉│ 2598900/2598961 (0:00:06 / 0:00:00)
Using 4 threads
Iter: 0
player 0 exploitability 2.072703
player 1 exploitability 1.734039
Total exploitability 47.584270 precent
time used: 0.03s

Iter: 1
player 0 exploitability 1.926970
player 1 exploitability 1.836820
Total exploitability 47.047371 precent
time used: 0.22s

Iter: 11
player 0 exploitability 0.293004
player 1 exploitability 0.095000
Total exploitability 4.850047 precent
time used: 0.28s

Iter: 21
player 0 exploitability 0.199628
player 1 exploitability -0.059344
Total exploitability 1.753547 precent
time used: 0.32s

Iter: 31
player 0 exploitability 0.156179
player 1 exploitability -0.100702
Total exploitability 0.693454 precent
time used: 0.36s

Iter: 41
player 0 exploitability 0.154044
player 1 exploitability -0.107528
Total exploitability 0.581459 precent
++++++++++++++++
solve finish, total time used: 0.37s
.Using 4 threads
Iter: 0
player 0 exploitability 1.653075
player 1 exploitability 2.146374
Total exploitability 47.493111 precent
time used: 0.01s

Iter: 1
player 0 exploitability 0.937044
player 1 exploitability 2.743413
Total exploitability 46.005707 precent
time used: 0.02s

Iter: 11
player 0 exploitability 0.040586
player 1 exploitability 0.322102
Total exploitability 4.533607 precent
time used: 0.02s

Iter: 21
player 0 exploitability -0.073854
player 1 exploitability 0.189015
Total exploitability 1.439512 precent
time used: 0.03s

Iter: 31
player 0 exploitability -0.105610
player 1 exploitability 0.163405
Total exploitability 0.722437 precent
time used: 0.03s

Iter: 41
player 0 exploitability -0.114473
player 1 exploitability 0.168947
Total exploitability 0.680923 precent
++++++++++++++++
solve finish, total time used: 0.04s
.Using 4 threads
Iter: 0
player 0 exploitability 2.218541
player 1 exploitability 2.348576
Total exploitability 57.088959 precent
time used: 0.46s

Iter: 1
player 0 exploitability 1.201122
player 1 exploitability 0.877050
Total exploitability 25.977146 precent
time used: 1.07s

Iter: 11
player 0 exploitability 0.407176
player 1 exploitability 0.191614
Total exploitability 7.484877 precent
time used: 1.98s

Iter: 21
player 0 exploitability 0.245336
player 1 exploitability -0.016597
Total exploitability 2.859249 precent
time used: 2.53s

Iter: 31
player 0 exploitability 0.185452
player 1 exploitability -0.078987
Total exploitability 1.330806 precent
time used: 3.11s

Iter: 41
player 0 exploitability 0.160364
player 1 exploitability -0.102730
Total exploitability 0.720429 precent
++++++++++++++++
solve finish, total time used: 3.60s
.Using 4 threads
Iter: 0
player 0 exploitability 2.659898
player 1 exploitability 2.561559
Total exploitability 65.268211 precent
time used: 0.31s

Iter: 1
player 0 exploitability 1.198172
player 1 exploitability 1.700879
Total exploitability 36.238136 precent
time used: 5.66s

Iter: 11
player 0 exploitability 0.226130
player 1 exploitability 0.114687
Total exploitability 4.260209 precent
time used: 11.17s

Iter: 21
player 0 exploitability 0.123826
player 1 exploitability 0.002493
Total exploitability 1.578979 precent
time used: 16.36s

Iter: 31
player 0 exploitability 0.085367
player 1 exploitability -0.040322
Total exploitability 0.563062 precent
time used: 21.89s

Iter: 41
player 0 exploitability 0.073824
player 1 exploitability -0.053925
Total exploitability 0.248744 precent
++++++++++++++++
solve finish, total time used: 26.59s
EUsing 4 threads
Iter: 0
player 0 exploitability 2.073847
player 1 exploitability 1.735141
Total exploitability 47.612354 precent
time used: 0.00s

Iter: 1
player 0 exploitability 1.893381
player 1 exploitability 1.837019
Total exploitability 46.630009 precent
time used: 0.02s

Iter: 11
player 0 exploitability 0.318011
player 1 exploitability 0.093080
Total exploitability 5.138637 precent
time used: 0.03s

Iter: 21
player 0 exploitability 0.200266
player 1 exploitability -0.065872
Total exploitability 1.679916 precent
time used: 0.04s

Iter: 31
player 0 exploitability 0.154990
player 1 exploitability -0.101124
Total exploitability 0.673333 precent
time used: 0.06s

Iter: 41
player 0 exploitability 0.143440
player 1 exploitability -0.111861
Total exploitability 0.394738 precent
++++++++++++++++
solve finish, total time used: 0.07s
.Using 4 threads
Iter: 0
player 0 exploitability 2.150103
player 1 exploitability 2.279707
Total exploitability 55.372631 precent
time used: 0.05s

Iter: 1
player 0 exploitability 1.012547
player 1 exploitability 0.686820
Total exploitability 21.242090 precent
time used: 0.55s

Iter: 11
player 0 exploitability 0.333881
player 1 exploitability 0.150937
Total exploitability 6.060219 precent
time used: 0.90s

Iter: 21
player 0 exploitability 0.190800
player 1 exploitability -0.014762
Total exploitability 2.200477 precent
time used: 1.25s

Iter: 31
player 0 exploitability 0.150024
player 1 exploitability -0.068069
Total exploitability 1.024435 precent
time used: 1.59s

Iter: 41
player 0 exploitability 0.130023
player 1 exploitability -0.085438
Total exploitability 0.557310 precent
++++++++++++++++
solve finish, total time used: 1.91s
.

ERROR: test_shortdeck_flop (main.TestSolver)

Traceback (most recent call last):
File "PokerSolver.java", line 139, in icybee.solver.runtime.PokerSolver.train
File "GameTree.java", line 902, in icybee.solver.GameTree.dumps
File "GameTree.java", line 856, in icybee.solver.GameTree.reConvertJson
File "GameTree.java", line 856, in icybee.solver.GameTree.reConvertJson
File "GameTree.java", line 856, in icybee.solver.GameTree.reConvertJson
File "GameTree.java", line 888, in icybee.solver.GameTree.reConvertJson
File "GameTree.java", line 865, in icybee.solver.GameTree.reConvertJson
File "DiscountedCfrTrainable.java", line 198, in icybee.solver.trainable.DiscountedCfrTrainable.dumps
File "String.java", line 2897, in java.lang.String.format
File "Formatter.java", line 2509, in java.util.Formatter.toString
File "StringBuilder.java", line 448, in java.lang.StringBuilder.toString
File "StringLatin1.java", line 715, in java.lang.StringLatin1.newString
Exception: Java Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "java_interface.py", line 62, in test_shortdeck_flop
result_json = self.ps_shortdeck.train(
java.lang.java.lang.OutOfMemoryError: java.lang.OutOfMemoryError: Java heap space


Ran 6 tests in 94.208s

`output_strategy.json` not generated?

Hey,
first, this is an awesome program!
Maybe this is more a question than an issue, in the description it says the output_strategy.json is generated after solving, but it is either not or I don't know where it is located.
I am using macOS, and I am happy to provide all the information you need.
Thanks

Raise "java.lang.RuntimeException: java.lang.RuntimeException" when build game tree

系统: windows 10
java version: 11.0.10
code as following:

`
from jpype import *
import yaml
import numpy as np
import sys
import os
resdir = "D:/poker/RiverSolver/RiverSolver/resources"
sys.path.append(resdir)
from python.TreeBuilder import *
import unittest
import pdb

cdir = "D:/poker/RiverSolver/RiverSolver"
path = cdir + "/RiverSolver.jar"
res = startJVM(getDefaultJVMPath(), "-ea", "-Djava.class.path=%s" % path)
os.chdir(cdir)

PokerSolver = JClass('icybee.solver.runtime.PokerSolver')

def test():
with open('./resources/yamls/general_rule.yaml') as fhdl:
conf = yaml.load(fhdl)
ps_holdem = PokerSolver("Dic5Compairer",
"./resources/compairer/card5_dic_sorted.txt",
2598961,
['A', 'K', 'Q', 'J', 'T', '9', '8', '7', '6', '5', '4', '3', '2'],
['h', 's', 'd', 'c']
)
rule = RulesBuilder(
conf,
current_commit = [2,2],
current_round = 4,
raise_limit = 1,
check_limit = 2,
small_blind = 0.5,
big_blind = 1,
stack = 10,
bet_sizes = ["0.5_pot","1_pot","2_pot","all-in"],
)
gameTree = PartGameTreeBuilder(rule)
depth = np.inf
json = gameTree.gen_km_json("./tree.km".format(depth), limit=depth, ret_json=True)

print("to build game tree in test holdem river")
ps_holdem.build_game_tree("./tree.km")

if name == 'main':
test()
`

报错信息如下:
D:\Mogu\venv\Scripts\python.exe D:/poker/RiverSolver/RiverSolver/resources/python/java_interface.py
D:/poker/RiverSolver/RiverSolver/resources/python/java_interface.py:297: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
conf = yaml.load(fhdl)
Dic5Comapirer Load 99% ��
to build game tree in test holdem river
Traceback (most recent call last):
File "PokerSolver.java", line 46, in icybee.solver.runtime.PokerSolver.build_game_tree
File "SolverEnvironment.java", line 77, in icybee.solver.SolverEnvironment.gameTreeFromJson
Exception: Java Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:/poker/RiverSolver/RiverSolver/resources/python/java_interface.py", line 326, in
test()
File "D:/poker/RiverSolver/RiverSolver/resources/python/java_interface.py", line 320, in test
ps_holdem.build_game_tree("./tree.km")
java.lang.RuntimeException: java.lang.RuntimeException

run release project error, load config failed

按照文档给出的链接安装了 java re

release包版本为 TexasHoldemSolverJava 0.2.0

下载后启动 jar 包,log窗口出现以下报错

initizing...
loading holdem compairer dictionary...
Exception in thread "Thread-0" java.lang.RuntimeException: load config failed: cannot find config file
	at icybee.solver.gui.SolverGui.loadConfig(SolverGui.java:100)
	at icybee.solver.gui.SolverGui.load_compairer(SolverGui.java:106)
	at icybee.solver.gui.SolverGui.initize(SolverGui.java:229)
	at icybee.solver.gui.SolverGui.access$000(SolverGui.java:23)
	at icybee.solver.gui.SolverGui$1.run(SolverGui.java:303)

本地 Java 版本为

java --version
openjdk 11.0.10 2021-01-19
OpenJDK Runtime Environment (build 11.0.10+9)
OpenJDK 64-Bit Server VM (build 11.0.10+9, mixed mode)

是需要进行什么配置文件进行配置吗?

下载后安装问题

捕获1
捕获2
捕获3

首先声明没有编程常识,电脑是win10。按照简介,下载对应的java.exe并安装了。win+R cmd 输入java,应该算安装成功了(图1)。
然后运行了RiverSolver.jar,发现打不开手牌范围的图,只是旁边出了几排提示文字(看不懂)。以及board牌面打开设置时只显示到8(很可惜没有留下截图)。

我以为是java配置什么问题,又搜了相关文章,什么建立jdk文件夹,搞了环境变量等等。
最后发现软件也打不开了,然后删了重装java等等,再把环境变量改回来(也不知道是否改回原来的样子了)。
目前的状况如图2和图3吧,打开时选择安装目录下的javaw.exe也是没有反应。

【打开报错求助】

按照步骤安装了JRE和release包,运行时报错,调至全英文目录后仍然报错……
image
image

init时内存溢出

initizing...
loading holdem compairer dictionary...
Exception in thread "Thread-1" java.lang.OutOfMemoryError: Java heap space
at java.util.Hashtable.(Unknown Source)
at java.util.Hashtable.(Unknown Source)
at icybee.solver.compairer.Dic5Compairer.load_compairer(Dic5Compairer.java:37)
at icybee.solver.compairer.Dic5Compairer.(Dic5Compairer.java:31)
at icybee.solver.SolverEnvironment.compairerFromConfig(SolverEnvironment.java:101)
at icybee.solver.gui.SolverGui.load_compairer(SolverGui.java:107)
at icybee.solver.gui.SolverGui.initize(SolverGui.java:229)
at icybee.solver.gui.SolverGui.access$000(SolverGui.java:23)
at icybee.solver.gui.SolverGui$1.run(SolverGui.java:303)

Solver Results

So from my understanding, after the solver completes a solve, it writes the results to a file. This file is then interpreted by some SolverResult class.

So my question is, is there any way to save these files and then re-import them into the SolverResult GUI to view the already solved scenario without re-running the sim?

Also where are these result files saved? Are they saved somewhere in the test/ directory?

Thanks for all your work.

Exception in thread "Thread-0" java.lang.RuntimeException: load config failed: cannot find config file

initizing...
loading holdem compairer dictionary...
Exception in thread "Thread-0" java.lang.RuntimeException: load config failed: cannot find config file
at icybee.solver.gui.SolverGui.loadConfig(SolverGui.java:100)
at icybee.solver.gui.SolverGui.load_compairer(SolverGui.java:106)
at icybee.solver.gui.SolverGui.initize(SolverGui.java:229)
at icybee.solver.gui.SolverGui.access$000(SolverGui.java:23)
at icybee.solver.gui.SolverGui$1.run(SolverGui.java:303)

TexasHoldem solver can't solve for a Flop only scenario

My JVM is running out of memory when solving for a scenario that only provides community flop cards, no Turn or River card.

Steps to Reproduce:

Screen Shot 2021-04-05 at 9 45 57 PM

Settings used above.

Ranges I used for IP and OOP:

NateRange-IP.txt
NateRange-OOP.txt

I did some digging with my Debugger, and it appears that either

A) The call to ParallelCfrPlusSolver.setTrainable(GameTreeNode node) is entering into an infinite recursive call state

or

B) The same call from above is not handling memory management between threads properly or creating two many threads.

Stack Trace from GUI application:

java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedConstructorAccessor2.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at icybee.solver.solver.ParallelCfrPlusSolver.setTrainable(ParallelCfrPlusSolver.java:173) at icybee.solver.solver.ParallelCfrPlusSolver.setTrainable(ParallelCfrPlusSolver.java:176) at icybee.solver.solver.ParallelCfrPlusSolver.setTrainable(ParallelCfrPlusSolver.java:176) at icybee.solver.solver.ParallelCfrPlusSolver.setTrainable(ParallelCfrPlusSolver.java:180) at icybee.solver.solver.ParallelCfrPlusSolver.setTrainable(ParallelCfrPlusSolver.java:176) at icybee.solver.solver.ParallelCfrPlusSolver.setTrainable(ParallelCfrPlusSolver.java:176) at icybee.solver.solver.ParallelCfrPlusSolver.setTrainable(ParallelCfrPlusSolver.java:180) at icybee.solver.solver.ParallelCfrPlusSolver.setTrainable(ParallelCfrPlusSolver.java:176) at icybee.solver.solver.ParallelCfrPlusSolver.setTrainable(ParallelCfrPlusSolver.java:176) at icybee.solver.solver.ParallelCfrPlusSolver.train(ParallelCfrPlusSolver.java:206) at icybee.solver.gui.SolverGui.solve(SolverGui.java:281) at icybee.solver.gui.SolverGui.access$200(SolverGui.java:23) at icybee.solver.gui.SolverGui$3$1.run(SolverGui.java:328) Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded at icybee.solver.trainable.DiscountedCfrTrainable.<init>(DiscountedCfrTrainable.java:78) ... 16 more

The base algorithm introduction

Hi,
You did a great job on this topic.
But about your algorithm, I am still confused about every step.
Are there any introductions about this algorithm for texas pokers?

For example, I am unsure how to combine the cards and actions during the iterations.

Thanks for your help.

How to run solver?

Hey, there seems to be a lot of newer files uploaded than it was in the tutorial video/README, would it be possible to get an update on how to run the newer files? Thanks so much! For example, java_interface.py is no longer available.

Terminating with uncaught exception of type NSException

偶尔在点击范围选择按钮时候会闪退(重试依然闪退),错误报告在下面。
点结果按钮也一样,似乎和打开新窗口有关。

Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGABRT)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000103333008
Exception Note: EXC_CORPSE_NOTIFY
VM Regions Near 0x103333008:
__LINKEDIT 10332b000-103333000 [ 32K] r--/rwx SM=COW /Library/Java/JavaVirtualMachines/jdk-11.0.12.jdk/Contents/Home/lib/libjimage.dylib
--> VM_ALLOCATE 103333000-103334000 [ 4K] ---/rwx SM=NUL
VM_ALLOCATE 103334000-103335000 [ 4K] r--/rwx SM=PRV

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[AWTView keyboardInputSourceChanged:]: unrecognized selector sent to class 0x10e6513b8'
abort() called
terminating with uncaught exception of type NSException

How to deal with multiple players?

Thanks for sharing the great work!

I wonder if current solvers can be applied to multiple people (e.g. 3-way pot), or are there any techniques related to it?

同学,您这个项目引入了13个开源组件,存在52个漏洞,辛苦升级一下

检测到 bupticybee/TexasHoldemSolverJava 一共引入了13个开源组件,存在52个漏洞

漏洞标题:SnakeYAML 安全漏洞
缺陷组件:org.yaml:[email protected]
漏洞编号:CVE-2017-18640
漏洞描述:SnakeYAML是一款基于Java的YAML解析器。
SnakeYAML 1.18版本中的Alias功能存在安全漏洞。攻击者可利用该漏洞造成拒绝服务。
国家漏洞库信息:https://www.cnvd.org.cn/flaw/show/CNVD-2020-22682
影响范围:(∞, 1.26)
最小修复版本:1.26
缺陷组件引入路径:icybee.riversolver:[email protected]>org.yaml:[email protected]

另外还有52个漏洞,详细报告:https://mofeisec.com/jr?p=icf692

打开程序后log报错

log提示下面报错是什么原因呢?(jre已经是11.0.2)
Exception in thread "Thread-0" java.lang.RuntimeException: load config failed: cannot find config file
at icybee.solver.gui.SolverGui.loadConfig(SolverGui.java:100)
at icybee.solver.gui.SolverGui.load_compairer(SolverGui.java:106)
at icybee.solver.gui.SolverGui.initize(SolverGui.java:229)
at icybee.solver.gui.SolverGui.access$000(SolverGui.java:23)
at icybee.solver.gui.SolverGui$1.run(SolverGui.java:303)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.