| Package | com.lookbackon.AI.searching |
| Class | public class Quiescence |
| Inheritance | Quiescence SearchingBase AbstractProcess Object |
| 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 | ||
![]() | SearchingBase | ||
![]() |
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 | |
![]() |
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 | |
| 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次子),而将军可以一直进行下去并导致无限制递归。 【对于是否展开将军着法的问题,可以尝试一种做法,如果局面被将军,就展开全部着法,即做应将处理,而不对当前局面作评价,参阅“静态搜索”一文。】
ParametersgamePosition:PositionVO | |
alpha:int (default = NaN) | |
beta:int (default = NaN) |
See also
| run | () | method |
override public function run():void