Packagecom.lookbackon.AI.searching
Classpublic class Quiescence
InheritanceQuiescence Inheritance SearchingBase Inheritance AbstractProcess Inheritance Object



Public Properties
 PropertyDefined By
 Inheritedcaptures : Vector.<ConductVO>
[read-only] This function generates all possible captures and stores them in the vector. It returns the vector of the legal captures for Quiescene searching.
SearchingBase
 Inheritedevaluation : IEvaluation
SearchingBase
 InheritedisSelfManaging : Boolean
AbstractProcess
 Inheritedmoves : Vector.<ConductVO>
[read-only]
SearchingBase
 InheritedorderingMoves : Vector.<ConductVO>
Ordering Moves To Speed Up Search As we will see next time, search efficiency depends on the order in which moves are searched. The gains and losses related to good or poor move ordering are not trivial: a good ordering, defined as one which will cause a large number of cutoffs, will result in a search tree about the square root of the size of the tree associated with the worst possible ordering! Unfortunately, it turns out that the best possible ordering is simply defined by trying the best move first.
SearchingBase
 Inheritedpercentage : Number
[override] [read-only] inheritDoc
SearchingBase
 InheritedprocessDone : Boolean
SearchingBase
Protected Properties
 PropertyDefined By
 Inheritedalpha : int
SearchingBase
 InheritedbestMove : ConductVO
SearchingBase
 InheritedbestValue : int
SearchingBase
 Inheritedbeta : int
SearchingBase
 InheritedchessBoardModel : ChessBoardModel
SearchingBase
 InheritedchessGasketsModel : ChessGasketsModel
SearchingBase
 InheritedchessPiecesModel : ChessPiecesModel
SearchingBase
 Inheriteddepth : int
SearchingBase
 InheritedgamePosition : PositionVO
SearchingBase
 InheritedgeneratedMoves : Vector.<ConductVO>
SearchingBase
 Inherited_isSelfManaging : Boolean
AbstractProcess
 InheritedpositionEvaluated : int
SearchingBase
 InheritedtempCapture : ConductVO
SearchingBase
 InheritedtempMove : ConductVO
SearchingBase
 InheritedtempValue : int
SearchingBase
Public Methods
 MethodDefined By
  
Quiescence(gamePosition:PositionVO, alpha:int, beta:int)
Quiescence search As I just said above, the basic search algorithm I presented always goes to a fixed depth. However, it may often not be a good idea to evaluate a position if it is too chaotic.
Quiescence
 Inherited
applyMove(conductVO:ConductVO):void
SearchingBase
 Inherited
doEvaluation(conductVO:ConductVO, gamePosition:PositionVO):int
The evaluation function will return positive values if the position is good for red and negative values. if the position is bad for red in the MinMax formulation. Many things could be said about evaluation functions, for me,the two main objectives in designing a evaluation function are speed and accuracy. The faster your evaluation function is,the better is. and the more accurate its evaluation is,the beeter. Obviously,these two things are somewhat at odds: an accurate evaluation function probably is slower than a 'quick-and-dirty' one. The evaluation function I'm taking about here is a heuristic one -not a exact one.
SearchingBase
 Inherited
generateMoves(pieces:Vector.<ChessPiece>):Vector.<ConductVO>
This function generates all possible moves and stores them in the vector. It returns the vector of the legal moves. While is checking,defend moves with high priority.
SearchingBase
 Inherited
makeMove(conductVO:ConductVO):void
Obviously,the struct move must contain all information necessary to support this operations. As always,the structures are passed by reference, in this case it is not only a speed question: the position will be modified by this functions.
SearchingBase
 Inherited
noneMove():int
SearchingBase
  
run():void
[override]
Quiescence
 Inherited
runAndManage(allocation:int):void
AbstractProcess
 Inherited
terminate():void
AbstractProcess
 Inherited
unmakeMove(conductVO:ConductVO):void
Unmake previous move,for all kinds of searching tree algorithms.
SearchingBase
 Inherited
willNoneMove(gamePosition:PositionVO):Boolean
SearchingBase
 Inherited
yield():void
AbstractProcess
Public Constants
 ConstantDefined By
 InheritedMAX_SEARCH_DEPTH : int = 5
SearchingBase
Constructor Detail
Quiescence()Constructor
public function Quiescence(gamePosition:PositionVO, alpha:int, beta:int)

Quiescence search As I just said above, the basic search algorithm I presented always goes to a fixed depth. However, it may often not be a good idea to evaluate a position if it is too chaotic. Exactly what too chaotic might mean depends on the game. A simple example in chess is a position where white to move is a rook down but can promote a pawn to a queen, winning the game. If we were to call our static evaluation function in this position, it would (unless it was smart, which evaluation functions usually aren't) conclude that white is dead lost, a rook down. Therefore, a technique called quiescence search is often used: Once you want to call your evaluation function, you take a look at very few select moves that need to be checked further. You have to make sure that you are very restrictive in your quiescence search, otherwise your search tree will explode completely. 静态搜索 在国际象棋或其他棋类中,有吃子和不吃子的着法(西洋跳棋、围棋、Fanorano等),如果有吃子的情况,那么每次吃子时评价都会改变。 “静态搜索”(Quiescence Search)的思想是,到达主搜索的水平线后,用一个图灵型的搜索只展开吃子(有时是吃子加将军)的着法。 其他棋类不同于国际象棋,可能只包括一些会很大程度上改变评价的着法。静态搜索还必须包括放弃的着法,来决定停止吃子。 因此,主Alpha-Beta搜索中每个调用评价函数的地方,都会被一个类似Alpha-Beta的但只搜索吃子着法的函数代替, 如果当前结点的评价函数足以高出边界,那么就让搜索停下来。 有人还把将军加入到静态搜索中,但是你要当心,由于没有深度参数,静态搜索会有巨大的结点数。 吃子通常是有限的(在棋子全部吃完以前你只能有16次子),而将军可以一直进行下去并导致无限制递归。 【对于是否展开将军着法的问题,可以尝试一种做法,如果局面被将军,就展开全部着法,即做应将处理,而不对当前局面作评价,参阅“静态搜索”一文。】

Parameters
gamePosition:PositionVO
 
alpha:int (default = NaN)
 
beta:int (default = NaN)

See also

Method Detail
run()method
override public function run():void