为Ludii游戏系统添加Python接口,对比不同实现的运行速度。
Python Agent in Ludii
- 用jpy和Py4J实现Python调用Ludii,支持用Python开发博弈智能体。
- 在多种棋类游戏中测试,jpy比Py4J快,但仍慢于原生Java版本。
- 适合希望用Python开发通用棋类博弈程序的研究者或开发者。
Ludii 是一个基于 Java 的通用棋类游戏系统,包含大量棋类游戏,提供开发新智能体的 API 及游戏描述语言。为提升灵活性并简化开发,本文提供了 Python 接口,使开发者可使用 Python 模块实现通用棋类博弈智能体。通过 jpy 与 Py4J 两种 Java 库实现接口,比较其性能差异。实验对比了 Minimax(适配通用棋类博弈)与 MCTS 算法在多个组合博弈上的表现,评估指标包括不同深度、分支因子和每回合时间。结果表明,尽管 jpy 优于 Py4J,但性能仍低于原生 Java Ludii 智能体。研究还构建回归预测模型,并公开教程与代码仓库以确保可复现性。
原文摘要 · Abstract (English)
Ludii is a Java general game system with a considerable number of board games, with an API for developing new agents and a game description language to create new games. To improve versatility and ease development, we provide Python interfaces for agent programming. This allows the use of Python modules to implement general game playing agents. As a means of enabling Python for creating Ludii agents, the interfaces are implemented using different Java libraries: jpy and Py4J. The main goal of this work is to determine which version is faster. To do so, we conducted a performance analysis of two different GGP algorithms, Minimax adapted to GGP and MCTS. The analysis was performed across several combinatorial games with varying depth, branching factor, and ply time. For reproducibility, we provide tutorials and repositories. Our analysis includes predictive models using regression, which suggest that jpy is faster than Py4J, however slower than a native Java Ludii agent, as expected.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。