请选择 进入手机版 | 继续访问电脑版

围棋AI开源项目 FueGo

烂柯野人 发表于 2015-7-31 16:52:12 | 显示全部楼层 [复制链接]
6 18681

FueGo是另一款开源围棋人工智能项目,与gungo的区别是它使用蒙特卡洛算法查找最优落子。官方网站:http://sourceforge.net/projects/fuego/
回复

使用道具 举报

发表于 2015-7-28 09:47:19 | 显示全部楼层
本帖最后由 烂柯野人 于 2015-7-28 09:59 编辑

FunGo最新源码下载地址:http://sourceforge.net/p/fuego/code/HEAD/tree/
以下是百度贴吧里关于Fuego的贴子,原文参见:http://tieba.baidu.com/p/1459924479

软件名称:FUEGO/孚围棋
软件版本:FueGo0.4
系列的最新版本:FueGo0.5
游戏类型:TAB桌面游戏
发行地区:Canada/加拿大
开发团队:Computer Go Group at the University of Alberta(M.Enzenberger, M.Müller, B.Arneson and R.Segal.Fuego)/加拿大阿尔伯塔大学计算机围棋开发团队
运行环境:windows
软件语言:英文
软件大小:7.36M
开发平台:C++
对弈引擎:Fuego
核心算法*:MC(Monte-Carlo)/蒙特卡洛
支持的人机对弈方式:棋盘:9路,11路,13路,15路,17路,19路
让子:2-9子
计算速度:**/稍慢
曾获战绩:2008年欧洲计算机围棋竞标赛9路盘第6名,19路盘第7名
2008年国际计算机游戏竞标赛围棋项目9路盘第4名,19路盘第4名
2009年韩国人机对抗赛在9路盘上
2009年计算机奥林匹克赛(综合性电脑博弈比赛)围棋项目9路盘冠军,19路盘亚军
2010年计算机奥林匹克赛(综合性电脑博弈比赛)围棋项目9路盘亚军,13路盘亚军,19路盘第5名
2010年第四届UEC杯围棋赛19路盘冠军
……
软件简介:Fuego is a collection of C++ libraries for developing software for the game of Go. It includes a Go player using Monte-Carlo tree search. The initial version of the code was released by the Computer Go Group at the University of Alberta and is based in parts on the previous projects Smart Game Board and Explorer.(转载自Fuego官网)
粗略人机测试结果:19路:我让它9子无贴目中盘胜了它
13路:我与它分先无贴目执白中盘胜了它
9路:我与它分先无贴目执白它胜了我8.5目
棋风、棋力评价:棋风柔和,棋力一般,算路不够精深,局部对杀尚可,但有时候又莫名其妙死棋活棋分不清楚,智能化程度还比较低,官子也较差,喜欢纠缠局部,不擅长脱先却经常无故脱离主战场。

PS:与MOGO一样,Fuego也是一段核心代码,不能自主运行,要依靠Gogui等图形界面软件辅助,关于Gogui的使用说明在下面。
回复 支持 反对

使用道具 举报

发表于 2015-7-28 10:18:06 | 显示全部楼层

sxcong的fuego源码分析1,原文地址:http://blog.chinaunix.net/uid-15063109-id-3191844.html

在开源的围棋项目中,fuego应该是棋力最强的了。
使用很简单,这里主要分析一下代码。
代码是c++的,可以在gcc下编译,用vc2010稍稍修改一下也可以。这不是主要的,关键这么小的项目,也引入了boost,向手机上移植,一是稍麻烦一点,当然fuego已经成功移植到iPhone上了。另外就是代码体积也庞大了一些。计划去掉boost,用标准c/c++修改成更通用一些。
fuego结构如下:


gtp是个通信协议,外挂一个界面,或双机对弈时使用。
smartgame是monte Carlo utc核心算法
go是围棋相关功能,比如棋盘布局,棋子链表。
gouct是围棋算法,调用smartgame。
fuegomain是与外界的接口,通过gtpengine传入命令,传出结果。
用到boost的地方主要在gtpengine和smartgame。
gtpengine很简单,就是stream的通话。
这样,重点就在smartgame上。

主要代码流程:
main()
{.....
SgInit();
GoInit();

FuegoMainEngine engine(g_fixedBoardSize, g_programPath, g_noHandicap);
.....
GtpInputStream in(cin);
GtpOutputStream out(cout);
engine.MainLoop(in, out);

}
很明显,FuegoMainEngine是主要处理模块。
再:
class FuegoMainEngine
    : public GoGtpEngine
{

...
GoUctCommands m_uctCommands;
}
明显看出,FuegoMainEngine接收命令,进行处理,再返回结果。

传入传出的命令遵守gtp协议。
到此,程序流程已经很清楚了,下一步开始分析命令,然后再进入算法。
看代码应该类似斯诺克,先轻轻一碰球,把握整体,再一一把球打进袋。用成语来解释,就是庖丁解牛。



回复 支持 反对

使用道具 举报

发表于 2015-7-28 10:48:37 | 显示全部楼层
Fuego 原文用户手册

Fuego User Manual

Graphical User Interface

Fuego is a Go playing engine, which communicates with a user interface using the Go Text Protocol (GTP). You need a graphical user interface that supports GTP to play against Fuego. The recommended one is GoGui because Fuego uses some of the special features of GoGui. The most important feature is the Analyze Command window, which makes engine-specific GTP extension commands accessible in the user interface. These commands allow to query and display internal information about the move generation and to set engine parameters. Some of these are only of interest to engine developers, some of them might also be useful for users.

Configuring Fuego for Your Machine

Fuego tries to use a reasonable default configuration with respect to memory usage and usage of parallel search on a multi-core or multi-CPU machine. Parameters can be changed with certain commands in the analyze window of GoGui, but this will affect only the current session. To optimize the default configuration for a certain machine in a persistent way, you can write a text file with GTP commands (e.g. configfile) and change the command line for invocation of Fuego in the user interface to fuego --config configfile. Here is an example of such a configuration file:

uct_param_search number_threads 4
uct_param_search lock_free 1
uct_max_memory 6000000000
uct_param_player reuse_subtree 1
uct_param_player ponder 1
The meaning of these GTP commands is:

uct_param_search number_threads
The number of threads to use. The default is the number of hardware threads available on the current machine.
uct_param_search lock_free
Whether to enable lock-free multithreading. The default is 1 (=yes) for modern Intel or AMD CPUs. This should be enabled on modern Intel or AMD CPUs (with IA-32 and Intel-64 architecture) if more than two threads are used. Note that without lock-free search the performance of Fuego can even decrease if you use more threads. The maximum number of threads that can be used without a decrease of performance, if the lock-free mode is not used, depends on the board size.
uct_max_memory
Determines the maximum amount of memory in the search tree, and thus the maximum memory to use. The default is half of the total memory available on the system. The example above is using 6GB. Fuego maintains two search trees internally, so setting max_memory to 512MB gives 256MB to each tree. The second tree is used for work space if using reuse_subtree, or if the search tree fills up and nodes with small counts are removed.
uct_param_player reuse_subtree
Whether to reuse the reusable part of the tree from a previous move generation. The default is 1 (=yes). Setting this to 1 is required if pondering is used, but it also gives a small improvement in playing strength if pondering is not used.
uct_param_player ponder
Whether to continue the search while waiting for the opponent's move. The default is 0 (=no). If this is set to 1, uct_param_player reuse_subtree must also be enabled. Note that with some versions of Fuego built with Cygwin pondering does not work and Fuego might hang on subsequent commands if it is enabled.
Game-specific Settings

This a list of some game-specific parameters, which can be changed in GoGui's analyze command window.

Go Param
There is one parameter that is interesting to users: Timelimit is the fixed time limit in seconds to use for a move generation, if no time settings are used for the game. The default is 10.
Go Param Rules
Change the rules used in the game. Note that entering text in the rules text entry of GoGui's game info dialog is for storing this information in the file only. It is not transmitted to the Go program because there is no GTP standard command for setting the rules. What rules are used by Fuego depends only on the settings in Go Param Rules.
Watching Fuego's Thinking Process

You can enable the display of Fuego's thinking process by setting Live gfx in the Uct Param Search analyze command to Counts or Sequence. Counts will show the current exploration counts of the moves as labels on the board and the currently best move using a half-transparent stone. Sequence will show the current best sequence of moves using half-transparent stones. The display interval can be configured with Live gfx interval.

Another display mode is Live gfx in the Uct Param GlobalSearch analyze command. It shows the statistics for ownership of each point averaged over all end positions of the simulations. This command requires that Territory statistics in Uct Param GlobalSearch is also enabled.
回复 支持 反对

使用道具 举报

发表于 2015-7-30 11:38:25 | 显示全部楼层
计划利用业余时间将Fuego译成javascript版本,欢迎有同样想法的人加入,一起研究一下。本贴将分享代码研究心得。
回复 支持 反对

使用道具 举报

发表于 2015-7-31 11:02:16 | 显示全部楼层
附件里是Fuego的代码说明,一共17页,值得收藏哦。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 支持 反对

使用道具 举报

发表于 2015-7-31 16:52:12 | 显示全部楼层
开炫项目不是都挪到github去了吗……
sf已死,还不停作死……
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

最新活动

排行榜

新品速递

新人课堂

  • 社区微博
  • 官方微信


关于我们

西宁维度信息技术有限公司成立于2011年,公司以软件开发为主业。烂柯围棋是公司自研产品,以后将逐步完善,使烂柯围棋成为新兴围棋品牌。

联系我们

  • 地址: 青海生物科技产业园经四路生科创业园4楼401
  • 电话: +86 (0) 0971-8127394
  • Email: 879500316@qq.com

分享到

团队成员

© 2011-2015 西宁维度信息技术有限公司,青ICP备13000468号-1
快速回复 返回顶部 返回列表