| Package | com.lookbackon.AI.searching |
| Class | public class NegaMax |
| Inheritance | NegaMax SearchingBase AbstractProcess Object |
See also
| Method | Defined By | ||
|---|---|---|---|
NegaMax(gamePosition:PositionVO, depth:int) | NegaMax | ||
![]() | SearchingBase | ||
[override]
The point is that the call value = -negamax(p,d-1);
takes care of the signs - or nearly. | NegaMax | ||
![]() | 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] | NegaMax | ||
![]() | 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 | |
| NegaMax | () | Constructor |
public function NegaMax(gamePosition:PositionVO, depth:int)gamePosition:PositionVO | |
depth:int |
| doEvaluation | () | method |
override public function doEvaluation(conductVO:ConductVO, gamePosition:PositionVO):intThe point is that the call value = -negamax(p,d-1); takes care of the signs - or nearly. There is one further modification we must make for this code to work: The evaluation function must be sensitive to the side to move - for a position with red to move it must return its normal evaluation, for a position with blue to move it must return -evaluation.
Parameters
conductVO:ConductVO | |
gamePosition:PositionVO |
int — evaluation result
|
| run | () | method |
override public function run():void