Packagecom.lookbackon.AI.searching
Classpublic class RandomWalk
InheritanceRandomWalk Inheritance SearchingBase Inheritance AbstractProcess Inheritance Object

This essay is a detailed explanation of one of the most important data structures ever created for Game Artificial Intelligence. The minimax tree is at the heart of almost every board game program in existence.



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
  
RandomWalk(gamePosition:PositionVO)
About RandomWalkAI(瞎走) if(game over in current board position) return winner, children = all legal moves for player from this board if(max's turn) return maximal score of calling minimax on all the children.
RandomWalk
 Inherited
applyMove(conductVO:ConductVO):void
SearchingBase
  
doEvaluation(conductVO:ConductVO, gamePosition:PositionVO):int
[override]
RandomWalk
 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]
RandomWalk
 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
RandomWalk()Constructor
public function RandomWalk(gamePosition:PositionVO)

About RandomWalkAI(瞎走) if(game over in current board position) return winner, children = all legal moves for player from this board if(max's turn) return maximal score of calling minimax on all the children. else (min's turn) return minimal score of calling minimax on all the children

Parameters
gamePosition:PositionVO
Method Detail
doEvaluation()method
override public function doEvaluation(conductVO:ConductVO, gamePosition:PositionVO):int

Parameters

conductVO:ConductVO
 
gamePosition:PositionVO

Returns
int
run()method 
override public function run():void