bupticybee / texasholdemsolverjava Goto Github PK
View Code? Open in Web Editor NEWA Java implemented Texas holdem and short deck Solver
License: MIT License
A Java implemented Texas holdem and short deck Solver
License: MIT License
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)
检测到 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
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
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:
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
method parameter of train
cannot support multiplayer
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.
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:
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
RT
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)
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.
按照哔哩哔哩视频中解压了zip,但是直接运行jar点击按钮报错了,我的电脑是Mac,jdk是8,这个和jdk版本有关系吗,但是我在idea中启动项目(依旧是jdk8)点击按钮都没问题
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.
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?
偶尔在点击范围选择按钮时候会闪退(重试依然闪退),错误报告在下面。
点结果按钮也一样,似乎和打开新窗口有关。
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
河牌和转牌都挺正常的
系统: 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
按照文档给出的链接安装了 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)
是需要进行什么配置文件进行配置吗?
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)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.