项目作者: zhixiangli

项目描述 :
Gomoku Battle is a cross-language cross-system battle platform.
高级语言: Java
项目地址: git://github.com/zhixiangli/gomoku-battle.git
创建时间: 2015-05-16T09:13:32Z
项目社区:https://github.com/zhixiangli/gomoku-battle

开源协议:

下载


GOMOKU BATTLE

An Example Game between Alpha-Beta-Search Agents

an example game between alpha-beta-search agents

Overview

Gomoku, also called Gobang or Five in a Row, is an abstract strategy board game.

Players alternate turns placing a stone of their color on an empty intersection. The winner is the first player to form an unbroken chain of five stones horizontally, vertically, or diagonally.

More details see wikipedia.

Gomoku Battle is a cross-language cross-system battle platform with lots of AI agent.

  • gomoku-battle-core: Basic Gomoku library.

  • gomoku-battle-console: A referee between AI agents. It also sends and receives commands to set up communication with AI agents.

  • gomoku-battle-dashboard: Dashboard is a viewer of a situation of the chessboard.

Launch Battle Platform

  1. git clone https://github.com/zhixiangli/gomoku-battle.git
  2. cd gomoku-battle
  3. sh build.sh
  4. sh battle.sh -c battle.properties

Configuration

AI Agent can be changed by modifying the player.properties

  • player.xxxxx.alias: set an alias for the agent.
  • player.xxxxx.cmd: a shell script to start an agent. No agent will start if the command is empty. Every agent should implement the following command.

A Configuration Example

  1. player.black.cmd=java -jar bin/gomoku-battle-alphabetasearch-0.0.1-SNAPSHOT-jar-with-dependencies.jar
  2. player.black.alias=alpha-beta-search
  3. player.white.cmd=java -jar bin/gomoku-battle-alphabetasearch-0.0.1-SNAPSHOT-jar-with-dependencies.jar
  4. player.white.alias=alpha-beta-search

AI Agent API

The console will create a subprocess for an AI agent.

The communication commands between console and AI agent is by stdin and stdout

Request

Field Description
command NEXT_BLACK (next color is black) or NEXT_WHITE (next color is white)
rows the number of rows in a chessboard
columns the number of columns in a chessboard
chessboard SGF

Sample Request

{“command”:”NEXT_BLACK”,”rows”:15,”columns”:15,”chessboard”:”B[96];W[a5];B[a4];W[95]”}

Response

return the position to make a move

Sample Response

{“rowIndex”:3,”columnIndex”:10}

AI Agent Example

AI Description Language Command Processor
alpha-beta-search Alpha Beta Search Agent Java AlphaBetaSearchAgent.java

Evaluation

  1. git clone https://github.com/zhixiangli/gomoku-battle.git
  2. cd gomoku-battle
  3. sh build.sh
  4. sh battle.sh -c battle.properties -d