libkombilo
0.7
|
Base class for hashing for general type patterns (currently works only for corner patterns). More...
#include <algos.h>
Public Member Functions | |
Algo_hash (int bsize, SnapshotVector DATA, string OS_DATA_NAME, int MAXNUMSTONES) | |
virtual void | initialize_process () |
Called by GameList::start_processing. | |
virtual void | newgame_process (int game_id) |
Called when a new game is about to be GameList::process'ed. | |
virtual void | AB_process (int x, int y) |
Called during processing, for each AB SGF tag. | |
virtual void | AW_process (int x, int y) |
Called during processing, for each AW SGF tag. | |
virtual void | AE_process (int x, int y, char removed) |
Called during processing, for each AE SGF tag. | |
virtual void | endOfNode_process () |
Called during processing, after fully processing a node (which might contain several AB , AW tags) | |
virtual void | move_process (Move m) |
Called during processing, for each move (B , W tags) | |
virtual void | pass_process () |
Called during processing, for each pass. | |
virtual void | branchpoint_process () |
Called during processing, for each node where a variation starts. | |
virtual void | endOfVariation_process () |
Called during processing, when reaching the end of variation ("jump back to most recent branchpoint") | |
virtual void | endgame_process (bool commit=true) |
Called during processing, when the end of the game is reached. | |
virtual void | finalize_process () |
Called by GameList::finalize_processing. | |
virtual int | search (PatternList &patternList, GameList &gl, SearchOptions &options) |
Protected Member Functions | |
SnapshotVector | get_data () |
Extract the relevant data from file at Kombilo startup. | |
virtual void | get_HHCS (int ptr, vector< HashhitCS * > *results, bool cs) |
virtual std::pair< hashtype, std::vector< int > > | compute_hashkey (PatternList &pl, int CS) |
Protected Attributes | |
int | maxNumStones |
std::vector< HashInstance > * | hi |
std::vector< std::pair < hashtype, int > > | hash_vector |
vector< pair< hashtype, int > > | data |
boost::unordered_multimap < hashtype, pair< int, int > > | data_p |
fstream | os_data |
Static Protected Attributes | |
static const hashtype | hashCodes [] |
Friends | |
class | GameList |
class | Algo_hash_full |
class | HashInstance |
Base class for hashing for general type patterns (currently works only for corner patterns).
void Algo_hash::get_HHCS | ( | int | ptr, |
vector< HashhitCS * > * | results, | ||
bool | cs | ||
) | [protected, virtual] |
takes a pointer to os_data, a vector results, and a bool cs (==colorSwitch) and adds the hits from the database to the results vector:
int Algo_hash::search | ( | PatternList & | patternList, |
GameList & | gl, | ||
SearchOptions & | options | ||
) | [virtual] |
Do a pattern search for the Pattern specified by patternList, in the GameList gl.
This computes the hashCode for the given pattern, looks it up in the database, and turns all records found there into Candidate entries which can be used by Algo_movelist::search If more than one corner lies inside the pattern, the hashCode for the corner which contains most stones is used.
Reimplemented from Algorithm.