42 #include <boost/unordered_map.hpp> 81 bool processVariations;
85 int algo_hash_full_maxNumStones;
86 int algo_hash_corner_maxNumStones;
89 std::string asString();
91 std::vector<std::string>* SGFTagsAsStrings();
103 bool searchInVariations;
107 SearchOptions(
int FIXEDCOLOR,
int NEXTMOVE=0,
int MOVELIMIT=10000);
115 std::string gameInfoStr;
118 std::vector<Hit* > * hits;
119 std::vector<Candidate* > * candidates;
121 GameListEntry(
int ID,
char WINNER, std::string GAMEINFOSTR,
int DATE);
125 void set_hits(vector<Hit* > * hts);
126 void set_candidates(vector<Candidate* > * cands);
148 const int OMIT_GAMES_WITH_SGF_ERRORS = 8;
156 const int UNACCEPTABLE_BOARDSIZE = 1;
162 const int IS_DUPLICATE = 4;
163 const int NOT_INSERTED_INTO_DB = 8;
164 const int INDEX_OUT_OF_RANGE = 16;
189 std::vector<std::pair<int,int> > * currentList;
191 std::vector<std::pair<int,int> > * oldList;
198 int processVariations;
201 std::vector<algo_p> algo_ps;
202 std::vector<GameListEntry* > * all;
206 vector<Continuation* > continuations;
236 std::string ORDERBY=
"",
259 std::string FORMAT=
"",
349 int process(const
char* sgf, const
char* path, const
char* fn,
std::vector<
GameList* > glists, const
char* DBTREE = 0,
int flags=0) throw(
SGFError,DBError);
363 int process_results(
unsigned int i=0);
365 void start_processing(
int PROCESSVARIATIONS=-1) throw(DBError);
366 void finalize_processing() throw(DBError);
373 char lookupLabel(
char x,
char y);
374 void setLabel(
char x,
char y,
char label);
381 void sigsearch(
char* sig) throw(DBError);
382 vector<
int> sigsearchNC(
char* sig) throw(DBError);
383 std::
string getSignature(
int i) throw(DBError);
388 void gisearch(const
char* sql,
int complete=0) throw(DBError);
394 vector<
int>* gisearchNC(const
char* sql,
int complete=0) throw(DBError);
412 void tagsearch(
int tag) throw(DBError);
421 void tagsearchSQL(
char* query) throw(DBError);
422 void setTag(
int tag,
int start=0,
int end=0) throw(DBError);
428 void setTagID(
int tag,
int i) throw(DBError);
436 vector<
int> getTagsID(
int i,
int tag=0) throw(DBError);
438 void deleteTag(
int tag,
int i = -1) throw(DBError);
449 std::vector<
int> getTags(
unsigned int i,
int tag=0) throw(DBError);
453 void export_tags(
string tag_db_name, vector<
int> which_tags);
454 void import_tags(
string tag_db_name);
459 int snapshot() throw(DBError);
460 void restore(
int handle,
bool del=false) throw(DBError);
461 void delete_snapshot(
int handle) throw(DBError);
462 void delete_all_snapshots() throw(DBError);
467 void resetFormat(
std::
string ORDERBY="",
std::
string FORMAT="");
470 std::
string get_resultsStr(
unsigned int i);
472 int find_by_ID(
int ID);
477 std::
string get_gameInfoStr(
unsigned int i);
478 pair<
int,
int> get_currentList_entry(
unsigned int i);
479 std::
string currentEntryAsString(
int i);
480 std::vector<
std::
string> currentEntriesAsStrings(
int start=0,
int end=0);
481 std::
string getSGF(
int i) throw(DBError);
482 std::
string getCurrentProperty(
int i,
std::
string tag) throw (DBError);
489 std::
string plEntry(
int i);
498 friend
int gis_callback(
void *gl,
int argc,
char **argv,
char **azColName);
499 friend
int gis_callbackNC(
void *pair_gl_CL,
int argc,
char **argv,
char **azColName);
502 void createGamesDB() throw(DBError);
503 void open_db() throw(DBError);
504 void readDB() throw(DBError);
505 void addAlgos(
bool NEW);
514 std::vector<
std::
string>* SGFtags;
515 std::
string sql_ins_rnp;
516 std::vector<
std::
string> pl;
517 void readPlayersList() throw(DBError);
518 std::vector<
std::vector<
int> >* duplicates;
519 std::vector<
int> process_results_vector;
526 void update_dates_current();
527 int get_current_index(
int id,
int* start);
530 int get_current_index_CL(
int id,
int start=0);
533 char getCurrentWinner();
534 int getCurrentDate();
536 void makeCurrentCandidate(
std::vector<
Candidate* > *candidates);
537 void makeCurrentHit(
std::vector<
Hit* > *hits);
538 void makeIndexCandidate(
int index,
std::vector<
Candidate* > *candidates);
539 void makeIndexHit(
int index,
std::vector<
Hit* > *hits, vector<
int>* CL = 0);
544 void setCurrentFromIndex(
int index);
545 void readNumOfWins() throw(DBError);
561 std::map<
std::
string,
std::vector<
int> >
find_duplicates(
std::vector<
string> glists,
bool strict=false,
bool dupl_within_db=false) throw(DBError);
565 const
int HANDI_TAG = 1;
566 const
int PROFESSIONAL_TAG = 2;
std::string rootNodeTags
a comma-separated list of those SGF tags which should be written to the database
Definition: search.h:83
Definition: pattern.h:119
Definition: sgfparser.h:74
int Bwins
number of hits in previous search where B wins (can exceed number of games if there are multiple hits...
Definition: search.h:209
vector< int > dates_current
a vector which counts, for each month between January 1600 and December 2020, the number of games in ...
Definition: search.h:219
const int OMIT_DUPLICATES
Omit games recognized as duplicates from the database.
Definition: search.h:147
Pattern * mrs_pattern
most recent search pattern
Definition: search.h:215
int WwinsAll
number of B wins in all games of the gamelist (independent of currentList)
Definition: search.h:214
Definition: pattern.h:189
Definition: sgfparser.h:37
Definition: pattern.h:242
vector< int > dates_all_per_year
a vector which counts, for each year between 1600 and 2020, the number of games in the all list ...
Definition: search.h:218
Definition: abstractboard.h:77
int algos
algorithms to be used
Definition: search.h:84
vector< int > dates_all
a vector which counts, for each month between January 1600 and December 2020, the number of games in ...
Definition: search.h:217
The GameList class is the main interface to the libkombilo functionality.
Definition: search.h:187
Definition: pattern.h:330
Definition: pattern.h:321
const int CHECK_FOR_DUPLICATES
check for duplicates using the signature
Definition: search.h:145
int BwinsG
number of games in currentList where B wins
Definition: search.h:210
const int CHECK_FOR_DUPLICATES_STRICT
check for duplicates using the final position (if ALGO_FINAPOS is available)
Definition: search.h:146
Base class for hashing for general type patterns (currently works only for corner patterns)...
Definition: algos.h:454
int Wwins
number of hits in previous search where W wins (can exceed number of games if there are multiple hits...
Definition: search.h:212
std::map< std::string, std::vector< int > > find_duplicates(std::vector< string > glists, bool strict=false, bool dupl_within_db=false)
Definition: search.cpp:2145
int WwinsG
number of games in currentList where W wins
Definition: search.h:213
int professional_tag
whether to use "P" tag (0 = don't use; 1 = always use; 2 = use for players with 1p to 9p ranks) ...
Definition: search.h:87
int BwinsAll
number of B wins in all games of the gamelist (independent of currentList)
Definition: search.h:211
const int SGF_ERROR
Definition: search.h:157
ProcessOptions()
sets default values which can be overwritten individually
Definition: search.cpp:125
Hashing for full board patterns.
Definition: algos.h:369
Hashing for corner patterns.
Definition: algos.h:506