⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 中国象棋对弈程序elephanteye(象眼).htm

📁 象棋程序设计全资料集(介绍编写象棋程序的方法思路)
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0050)http://www.elephantbase.net/league/elephanteye.htm -->
<HTML><HEAD><TITLE>中国象棋对弈程序ElephantEye(象眼)</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb_2312-80">
<META content="MSHTML 6.00.3790.536" name=GENERATOR></HEAD>
<BODY background=中国象棋对弈程序ElephantEye(象眼)_files/background.gif>
<DL>
  <DIV align=center>
  <CENTER>
  <DT><FONT face=隶书 size=6><IMG height=32 
  src="中国象棋对弈程序ElephantEye(象眼)_files/elephanteye.gif" 
  width=32>中国象棋对弈程序</FONT><FONT face=Arial 
  size=6><STRONG>ElephantEye(</STRONG></FONT><FONT face=隶书 size=6>象眼</FONT><FONT 
  face=Arial size=6><STRONG>)</STRONG></FONT><FONT face=楷体_GB2312 
  size=4><STRONG> 版本:</STRONG></FONT><FONT face=Arial 
  size=4><STRONG>1.3</STRONG></FONT> </CENTER></DT></DIV>
  <DIV align=center>
  <CENTER>
  <DT>  </CENTER></DT></DIV>
  <DIV align=center>
  <CENTER>
  <DT>黄晨 <FONT face="Times New Roman">*</FONT> <FONT 
  face="Times New Roman">2006</FONT>年<FONT face="Times New Roman">3</FONT>月 
  </CENTER></DT></DIV>
  <DIV align=center>
  <CENTER>
  <DT><FONT face="Times New Roman">( * </FONT>联系地址:复旦大学化学系表面化学实验室,<FONT 
  face="Times New Roman">eMail</FONT>:<A 
  href="mailto:webmaster@elephantbase.net"><FONT 
  face="Times New Roman">webmaster@elephantbase.net</FONT></A><FONT 
  face="Times New Roman">)</FONT> </CENTER></DT></DIV>
  <DIV align=left>
  <DT>  </DT></DIV>
  <DIV align=left>
  <DT><FONT face=楷体_GB2312 size=4><STRONG>一、简介</STRONG></FONT> </DT></DIV>
  <DIV align=left>
  <DT>  </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye </FONT>是一款自由的中国象棋程序,在遵循《<FONT 
  face="Times New Roman">GNU</FONT>通用公共许可协议》<FONT face="Times New Roman">(GNU 
  General Public Licence)</FONT>的前提下,广大象棋爱好者和程序设计师可以以任何非商业的目的使用 <FONT 
  face="Times New Roman">ElephantEye </FONT>及其源程序。 </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye 
  </FONT>中文名称为“象眼”,它跟“马腿”和“炮架子”一起构成了中国象棋“棋盘上的第三维”。<FONT 
  face="Times New Roman">ElephantEye </FONT>通常与一个象棋棋谱编辑软件<FONT 
  face="Times New Roman">ElephantBoard </FONT>配合使用,寓意有板有眼<FONT 
  face="Times New Roman">(</FONT>英文 <FONT face="Times New Roman">Board 
  </FONT>的意思是“板”<FONT face="Times New Roman">)</FONT>。<FONT 
  face="Times New Roman">(</FONT>注:现在 <FONT face="Times New Roman">ElephantBoard 
  </FONT>已更名为“象棋巫师”。<FONT face="Times New Roman">)</FONT> </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye 1.00 </FONT>作为<FONT 
  face="Times New Roman">2005</FONT>年在台北举办的第<FONT 
  face="Times New Roman">10</FONT>届电脑奥林匹克大赛的参赛程序,得到了郑明政<FONT 
  face="Times New Roman">(</FONT>网名 <FONT 
  face="Times New Roman">Poor)</FONT>、施金山<FONT 
  face="Times New Roman">(</FONT>网名专家<FONT 
  face="Times New Roman">)</FONT>以及《象棋百科全书论坛》全体网友的大力支持,在此作者向他们表示感谢。 </DT></DIV>
  <DIV align=left>
  <DT>  </DT></DIV>
  <DIV align=left>
  <DT><FONT face=楷体_GB2312 size=4><STRONG>二、引擎协议</STRONG></FONT> </DT></DIV>
  <DIV align=left>
  <DT>  </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye </FONT>支持<FONT 
  face="Times New Roman">UCCI</FONT>协议<FONT 
  face="Times New Roman">1.02</FONT>,<FONT face="Times New Roman">ElephantEye 
  1.04</FONT>及其以后版本不再支持浅红象棋协议,浅红象棋用户可使用<FONT 
  face="Times New Roman">UCCI</FONT>引擎适配器<FONT 
  face="Times New Roman">(UCCI2QH)</FONT>。 </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(1) </FONT>支持的<FONT 
  face="Times New Roman">UCCI</FONT>协议的命令有: </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ucci</FONT> </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">setoption ...</FONT> </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">position {&lt;special_position&gt; | fen 
  &lt;fen_str&gt;} [moves &lt;move_list&gt;]</FONT> </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">banmoves &lt;move_list&gt;</FONT> 
  </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">go [ponder] {time &lt;time&gt; [movestogo 
  &lt;moves_to_go&gt; | increment &lt;increment&gt;] | depth &lt;depth&gt; | 
  infinite}</FONT> </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ponderhit | stop</FONT> </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">quit</FONT> </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(2) </FONT>可以返回的<FONT 
  face="Times New Roman">UCCI</FONT>协议的信息有: </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">id {name &lt;engine_name&gt; | copyright 
  &lt;copyright_info&gt; | author &lt;author_name&gt; | user 
  &lt;user_name&gt;}</FONT> </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">option ...</FONT> </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ucciok</FONT> </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">info ...</FONT> </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">{nobestmove | bestmove &lt;best_move&gt; 
  [ponder &lt;ponder_move&gt;]}</FONT> </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">bye</FONT> </DT></DIV>
  <DIV align=left>
  <DT>  </DT></DIV>
  <DIV align=left>
  <DT><FONT face=楷体_GB2312 size=4><STRONG>三、参数设置</STRONG></FONT> </DT></DIV>
  <DIV align=left>
  <DT>  </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye </FONT>作为<FONT 
  face="Times New Roman">UCCI</FONT>引擎,有若干可以设置的参数<FONT 
  face="Times New Roman">(</FONT>可以直接在《象棋巫师》中设置<FONT 
  face="Times New Roman">)</FONT>。 </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(1) </FONT>开局库: </DT></DIV>
  <DIV align=left>
  <DT>  默认的开局库为 <FONT face="Times New Roman">ElephantEye </FONT>程序<FONT 
  face="Times New Roman">(ELEEYE.EXE)</FONT>当前目录下的 <FONT 
  face="Times New Roman">BOOK.DAT</FONT>,在设置完开局库后,必须执行“导入开局库”命令才会生效,建立新局或者重新启动《象棋巫师》都会自动导入开局库。目前 
  <FONT face="Times New Roman">ElephantEye 
  </FONT>只支持一个开局库文件,设置多个开局库反而会导致程序连一个开局库也无法读取。 </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(2) </FONT>思考时间: </DT></DIV>
  <DIV align=left>
  <DT>  限定思考深度通常不是很好的选择,建议给定限时让程序自动分配时间。而在解杀局或分析局面时,则可让程序无限制思考,并可随时中止思考。 
  </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(3) </FONT>置换表大小: </DT></DIV>
  <DIV align=left>
  <DT>  尽管置换表大小对程序的运行速度影响不大,默认<FONT 
  face="Times New Roman">16MB</FONT>的设置已经足够,但<FONT 
  face="Times New Roman">ElephantEye 
  </FONT>还是提供了设置置换表大小的功能。在内存允许的情况下,下慢棋时可以适当增加置换表的大小,但建议不要超过物理内存的一半。 </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(3) </FONT>裁剪程度: </DT></DIV>
  <DIV align=left>
  <DT>  为加快程序的运算速度,<FONT face="Times New Roman">ElephantEye 
  </FONT>默认使用空着裁剪和历史表裁剪,并且产生负面影响的可能性很小,因此推荐使用最高级别。中间两个级别会禁用历史表裁剪,最低级别会禁用空着裁剪。 
  </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(4) </FONT>知识量: </DT></DIV>
  <DIV align=left>
  <DT>  知识量和局面评价的准确性有关,在 <FONT face="Times New Roman">ElephantEye 
  </FONT>的知识量等级中,只有最低级别是不采用局面评价函数的<FONT 
  face="Times New Roman">(</FONT>只考虑子力价值<FONT 
  face="Times New Roman">)</FONT>,在解排局等不需要依靠审局知识来分析的局面时,可以尝试用这种设置。 </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(5) </FONT>选择性: </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye </FONT>设有<FONT 
  face="Times New Roman">4</FONT>级选择性。选择性越大,程序越有可能走出它认为不是最好的着法,但“不是最好的着法”并非一点好处也没有,尤其在没有启用开局库时,适当增大选择性,可以避免程序在相同的局面下走出一样的着法。 
  </DT></DIV>
  <DIV align=left>
  <DT>  </DT></DIV>
  <DIV align=left>
  <DT><FONT face=楷体_GB2312 size=4><STRONG>四、规则</STRONG></FONT> </DT></DIV>
  <DIV align=left>
  <DT>  </DT></DIV>
  <DIV align=left>
  <DT>  尽管 <FONT face="Times New Roman">ElephantEye 
  </FONT>现有的规则知识仅限于“单方面长将作负”,但有很多变通的做法让 <FONT face="Times New Roman">ElephantEye 
  </FONT>适应各种规则。例如作为浅红象棋引擎,长捉的着法会自动被“浅红象棋”所禁止。 </DT></DIV>
  <DIV align=left>
  <DT>  而作为<FONT face="Times New Roman">UCCI</FONT>引擎,尽管目前支持 <FONT 
  face="Times New Roman">UCCI </FONT>引擎的程序《象棋巫师》不会向引擎发送 <FONT 
  face="Times New Roman">banmoves </FONT>的禁着指令,但当局面出现三次重复时,<FONT 
  face="Times New Roman">ElephantEye </FONT>会自动变着,避免走出长捉等禁止着法。因此用户在与 <FONT 
  face="Times New Roman">ElephantEye </FONT>对弈时,可按照以下步骤来让 <FONT 
  face="Times New Roman">ElephantEye </FONT>适应规则: </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">a. </FONT>当局面出现三次重复时,《象棋巫师》会作出一个初步的裁定; 
  </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">b. </FONT>如果判定结果是某方长打作负,则不应该存在异议; 
  </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">c. </FONT>如果《象棋巫师》判定和棋,则需要由用户确认是否的确是和棋; 
  </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">d. </FONT>如果用户判定确实为和棋,则可结束棋局; </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">e. </FONT>如果用户判定 <FONT 
  face="Times New Roman">ElephantEye </FONT>存在长打的着法,则可继续对局,此后<FONT 
  face="Times New Roman">ElephantEye </FONT>会自动变着,避免重复局面的出现。 </DT></DIV>
  <DIV align=left>
  <DT>  </DT></DIV>
  <DIV align=left>
  <DT><FONT face=楷体_GB2312 size=4><STRONG>五、博弈算法</STRONG></FONT> </DT></DIV>
  <DIV align=left>
  <DT>  </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye 
  </FONT>属于偏向蛮力的象棋程序,使用了严谨而有效的博弈算法: </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(1) </FONT>使用位行和位列的着法生成器: </DT></DIV>
  <DIV align=left>
  <DT>  位行<FONT face="Times New Roman">(BitRanks)</FONT>和位列<FONT 
  face="Times New Roman">(BitFiles)</FONT>有利于滑动棋子<FONT 
  face="Times New Roman">(</FONT>车和炮<FONT 
  face="Times New Roman">)</FONT>的着法<FONT 
  face="Times New Roman">(</FONT>尤其是吃子着法<FONT 
  face="Times New Roman">)</FONT>生成,位行和位列可以用查表来代替在射线上做的循环运算。在<FONT 
  face="Times New Roman">ElephantEye </FONT>中,位行和位列的技术不仅用在着法生成器中,也用到了牵制的判断上。 
  </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(2) </FONT>静态局面搜索: </DT></DIV>
  <DIV align=left>
  <DT>  在做静态搜索时,<FONT face="Times New Roman">ElephantEye 
  </FONT>搜索了吃子或解将的着法,在搜索吃子着法时,<FONT face="Times New Roman">ElephantEye 
  </FONT>过滤掉不重要的吃子,例如吃不过河的兵、吃不处于防守中的士象等着法,都不在静态搜索的范围之内。 </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(3) </FONT>循环着法和长将检测: </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye 
  </FONT>可以识别循环着法,出现循环着法时可以判断哪方为长将,并且会利用禁止长将的规则来谋求优势,但目前 <FONT 
  face="Times New Roman">ElephantEye </FONT>还无法识别长捉。 </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(4) </FONT>置换表: </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye 
  </FONT>参考了中国象棋程序“纵马奔流”的设计思路,使用深度优先和始终覆盖的双层置换表,并采用低出<FONT 
  face="Times New Roman">(</FONT>高出<FONT 
  face="Times New Roman">)</FONT>边界修正的置换表更新策略。 </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(5) </FONT>带检验的空着裁剪: </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye </FONT>使用 <FONT 
  face="Times New Roman">R=2 </FONT>的空着裁剪,在残局阶段使用带检验的空着裁剪。 </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(6) </FONT>迭代加深<FONT 
  face="Times New Roman">/</FONT>吃子着法<FONT 
  face="Times New Roman">/</FONT>杀手着法<FONT face="Times New Roman">/</FONT>历史表启发: 
  </DT></DIV>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -