int file_num;
time_t timestamp;
long start_position;
+ int computer;
bool operator< (const Element& other) const {
int s = memcmp_different_len(bpfen, bpfen_len, other.bpfen, other.bpfen_len);
} else if (e.result == BLACK) {
c.set_black(c.black() + 1);
}
+ c.set_computer(c.computer() + e.computer);
if (e.white_elo >= 100 && e.black_elo >= 100) {
c.set_sum_white_elo(c.sum_white_elo() + e.white_elo);
c.set_sum_black_elo(c.sum_black_elo() + e.black_elo);
exit(1);
}
+ int computer = getc(fp);
+ if (computer == -1) {
+ perror("getc(computer)");
+ exit(1);
+ }
char move[8];
int l = getc(fp);
e.bpfen_len = bpfen_len;
strcpy(e.move, move);
e.result = Result(r);
+ e.computer = computer;
e.opening_num = opening_num;
e.white_elo = white_elo;
e.black_elo = black_elo;
(
PGNNUM=0
for FILE in "$@"; do
+ COMP=0
+ if echo "$FILE" | grep -q ^comp:; then
+ COMP=1
+ FILE=$( echo "$FILE" | sed s/comp:// )
+ fi
START=$( ./find-pgn-split-point.sh "$FILE" $X $MAPPERS )
END=$( ./find-pgn-split-point.sh "$FILE" $(( X + 1 )) $MAPPERS )
- ~/nmu/pgn-extract/pgn-extract --startpos $START --endpos $END --startfilenum $PGNNUM -e -Wsessebin "$FILE" 2>/dev/null
+ ~/nmu/pgn-extract/pgn-extract --computerflag $COMP --startpos $START --endpos $END --startfilenum $PGNNUM -e -Wsessebin "$FILE" 2>/dev/null
PGNNUM=$(( PGNNUM + 1 ))
done
) | ./binloader - tmp.mtbl.mapper$X $SHARDS 500000
optional int32 draw = 2;
optional int32 black = 3;
+ // Number of games played by computers.
+ optional int32 computer = 12;
+
// Opening number (32-bit hash value).
optional fixed32 opening_num = 4;
c.set_white(c0.white() + c1.white());
c.set_draw(c0.draw() + c1.draw());
c.set_black(c0.black() + c1.black());
+ c.set_computer(c0.computer() + c1.computer());
c.set_sum_white_elo(c0.sum_white_elo() + c1.sum_white_elo());
c.set_sum_black_elo(c0.sum_black_elo() + c1.sum_black_elo());
c.set_num_elo(c0.num_elo() + c1.num_elo());