Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Please keep each section in ASCII (LC_ALL=C sort) order.

# File patterns to ignore. This applies recursively to all subdirectories.
*.o
.depend

# Per directory patterns to ignore. These do not apply recursively to
# subdirectories. Each line should begin with "[!]/". Please keep the
# directories in depth first order followed by ASCII (LC_ALL=C sort) order.

/src/polyglot
41 changes: 11 additions & 30 deletions src/book_make.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,7 @@ void book_make(int argc, char * argv[]) {
book_sort();

printf("saving entries ...\n");
// if (Storage == LEVELDB) {
// printf("Saving to leveldb.. \n");
// book_save(NULL, leveldb_file);
// }
// else {
book_save(bin_file, NULL);
// }
}


Expand Down Expand Up @@ -349,32 +343,19 @@ static void book_insert(const char file_name[], const char leveldb_file_name[])

pos = find_entry(board,move);

// if (Storage==POLYGLOT) {
// Book->entry[pos].n++;
// Book->entry[pos].sum += result+1;
Book->entry[pos].game_ids->insert(game_nb);

if (leveldb_file_name!=NULL) {
Book->entry[pos].game_ids->insert(game_nb);
}
else {
Book->entry[pos].n++;
Book->entry[pos].sum += result+1;

}

// if (Book->entry[pos].n >= COUNT_MAX) {
//
// halve_stats(board->key);
// }
// }
// else {
// std::stringstream game_id_stream;
// std::string currentValue;
// leveldb::Status s = db->Get(leveldb::ReadOptions(), uint64_to_string(board->key), &currentValue);
// if (s.ok()) {
// game_id_stream << currentValue;
// }
//
// game_id_stream << game_nb << ",";
//// for (set<int>::iterator it = Book->entry[pos].game_ids->begin(); it != Book->entry[pos].game_ids->end(); ++it) {
//// game_id_stream << *it << ",";
//// }
//// writeBatch.Put(uint64_to_string(board->key), game_id_stream.str());
//// db->Put(writeOptions, uint64_to_string(board->key), game_id_stream.str());
//
// }


move_do(board,move);
ply++;
Expand Down Expand Up @@ -682,7 +663,7 @@ static bool keep_entry(int pos) {

entry = &Book->entry[pos];

// if (entry->n == 0) return false;
// if (entry->n == 0) return false;
if (entry->n < MinGame) return false;

if (entry->sum == 0) return false;
Expand Down