Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

CChessMemory Class Reference

Class that stores and retrieves positions already known. More...

#include <ChessMemory.h>


Public Member Functions

void Store (const CChessBoard *nodo, int iDepth)
 Bug: the second entry of a board should overlap the first (not done).
CMemoryChessBoardFindChessboard (const CChessBoard *cbNodo, int iDepth)
 This function is not so trivial as it would seem It searches a board in the memory, but the node found must at least have been analysed until a depth given by iDepth.
void Clear ()
 Erases the full memory.
int getMemorySize () const
 Returns the size of the memory.


Detailed Description

Class that stores and retrieves positions already known.

No hash has been done, pending to do in the future. It is a singleton class. No pointers are stored because they are dangerous: only full objects. Therefore there are no pointer to the best board: only indication of the move. The best continuation may exist but *MUST* be ignored.


Member Function Documentation

void CChessMemory::Clear  ) 
 

Erases the full memory.

Useful for debug operations.

CMemoryChessBoard * CChessMemory::FindChessboard const CChessBoard cbNodo,
int  iDepth
 

This function is not so trivial as it would seem It searches a board in the memory, but the node found must at least have been analysed until a depth given by iDepth.

If the node is found and this is satisfied, then: the best move is applied, so that cbNodo->m_cbBest is not null, and then it is returned. Timing: 30 microseconds for a memory of 20 elements. 50 microseconds for a memory of 100 elements 90 microseconds for a memory of 200 element

Parameters:
cbNodo Node to be found
iDepth Minimum depth to be considered acceptable
Returns:
The found node. Theoretically, it should be hold the same as content ascbNodo. CHECK IT!. It is a pointer to the node in the memory.

int CChessMemory::getMemorySize  )  const
 

Returns the size of the memory.

Returns:
The number of positions stored.

void CChessMemory::Store const CChessBoard cbNodo,
int  iDepth
 

Bug: the second entry of a board should overlap the first (not done).

A mayor Depth, mayor fiabilidad en el analisis Posiciones de libro, deberian ser introducidas con iDepth = M.


The documentation for this class was generated from the following files:
Generated on Sun Sep 24 19:55:08 2006 for Omar by  doxygen 1.4.4