GODPAPER | All Packages | All Classes | Index | Frames No Frames |
Quiescence

Package | com.lookbackon.AI.searching
Class | public class Quiescence
Inheritance | Quiescence SearchingBase AbstractProcess Object

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | captures : 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
|  | evaluation : IEvaluation | SearchingBase
|  | isSelfManaging : Boolean | AbstractProcess
|  | moves : Vector.<ConductVO> [read-only] | SearchingBase
|  | orderingMoves : 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
|  | percentage : Number [override] [read-only] inheritDoc | SearchingBase
|  | processDone : Boolean | SearchingBase

Protected Properties
Hide Inherited Protected Properties
Show Inherited Protected Properties

| Property | Defined By
--- | --- | ---
|  | alpha : int | SearchingBase
|  | bestMove : ConductVO | SearchingBase
|  | bestValue : int | SearchingBase
|  | beta : int | SearchingBase
|  | chessBoardModel : ChessBoardModel | SearchingBase
|  | chessGasketsModel : ChessGasketsModel | SearchingBase
|  | chessPiecesModel : ChessPiecesModel | SearchingBase
|  | depth : int | SearchingBase
|  | gamePosition : PositionVO | SearchingBase
|  | generatedMoves : Vector.<ConductVO> | SearchingBase
|  | _isSelfManaging : Boolean | AbstractProcess
|  | positionEvaluated : int | SearchingBase
|  | tempCapture : ConductVO | SearchingBase
|  | tempMove : ConductVO | SearchingBase
|  | tempValue : int | SearchingBase

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined 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
|  | applyMove(conductVO:ConductVO):void | SearchingBase
|  | 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
|  | 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
|  | 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
|  | noneMove():int | SearchingBase
|  | run():void [override] | Quiescence
|  | runAndManage(allocation:int):void | AbstractProcess
|  | terminate():void | AbstractProcess
|  | unmakeMove(conductVO:ConductVO):void Unmake previous move,for all kinds of searching tree algorithms. | SearchingBase
|  | willNoneMove(gamePosition:PositionVO):Boolean | SearchingBase
|  | yield():void | AbstractProcess

Public Constants
Hide Inherited Public Constants
Show Inherited Public Constants

| Constant | Defined By
--- | --- | ---
|  | MAX_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

http://www.fierz.ch/strategy.htm
http://chessprogramming.wikispaces.com/Quiescence+Search
Method Detail

run | () | method

`override public function run():void`

Thu Jan 16 2014, 01:11 PM +08:00