mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-02-12 07:07:54 +01:00
add hashfull information
This commit is contained in:
parent
c144bb9800
commit
cf56850d7e
|
@ -888,6 +888,7 @@ public class DroidComputerPlayer {
|
||||||
private int statTime = 0;
|
private int statTime = 0;
|
||||||
private long statNodes = 0;
|
private long statNodes = 0;
|
||||||
private long statTBHits = 0;
|
private long statTBHits = 0;
|
||||||
|
private int statHash = 0;
|
||||||
private int statNps = 0;
|
private int statNps = 0;
|
||||||
private ArrayList<String> statPV = new ArrayList<String>();
|
private ArrayList<String> statPV = new ArrayList<String>();
|
||||||
private String statCurrMove = "";
|
private String statCurrMove = "";
|
||||||
|
@ -905,6 +906,7 @@ public class DroidComputerPlayer {
|
||||||
statIsMate = statUpperBound = statLowerBound = false;
|
statIsMate = statUpperBound = statLowerBound = false;
|
||||||
statTime = 0;
|
statTime = 0;
|
||||||
statNodes = statTBHits = 0;
|
statNodes = statTBHits = 0;
|
||||||
|
statHash = 0;
|
||||||
statNps = 0;
|
statNps = 0;
|
||||||
depthModified = true;
|
depthModified = true;
|
||||||
currMoveModified = true;
|
currMoveModified = true;
|
||||||
|
@ -952,6 +954,9 @@ public class DroidComputerPlayer {
|
||||||
} else if (is.equals("tbhits")) {
|
} else if (is.equals("tbhits")) {
|
||||||
statTBHits = Long.parseLong(tokens[i++]);
|
statTBHits = Long.parseLong(tokens[i++]);
|
||||||
statsModified = true;
|
statsModified = true;
|
||||||
|
}else if (is.equals("hashfull")) {
|
||||||
|
statHash = Integer.parseInt(tokens[i++]);
|
||||||
|
statsModified = true;
|
||||||
} else if (is.equals("nps")) {
|
} else if (is.equals("nps")) {
|
||||||
statNps = Integer.parseInt(tokens[i++]);
|
statNps = Integer.parseInt(tokens[i++]);
|
||||||
statsModified = true;
|
statsModified = true;
|
||||||
|
@ -984,14 +989,14 @@ public class DroidComputerPlayer {
|
||||||
}
|
}
|
||||||
if (havePvData) {
|
if (havePvData) {
|
||||||
while (statPvInfo.size() < pvNum)
|
while (statPvInfo.size() < pvNum)
|
||||||
statPvInfo.add(new PvInfo(0, 0, 0, 0, 0, 0, false, false, false, new ArrayList<Move>()));
|
statPvInfo.add(new PvInfo(0, 0, 0, 0, 0, 0, 0, false, false, false, new ArrayList<Move>()));
|
||||||
while (statPvInfo.size() <= pvNum)
|
while (statPvInfo.size() <= pvNum)
|
||||||
statPvInfo.add(null);
|
statPvInfo.add(null);
|
||||||
ArrayList<Move> moves = new ArrayList<Move>();
|
ArrayList<Move> moves = new ArrayList<Move>();
|
||||||
int nMoves = statPV.size();
|
int nMoves = statPV.size();
|
||||||
for (i = 0; i < nMoves; i++)
|
for (i = 0; i < nMoves; i++)
|
||||||
moves.add(TextIO.UCIstringToMove(statPV.get(i)));
|
moves.add(TextIO.UCIstringToMove(statPV.get(i)));
|
||||||
statPvInfo.set(pvNum, new PvInfo(statPVDepth, statScore, statTime, statNodes, statNps, statTBHits,
|
statPvInfo.set(pvNum, new PvInfo(statPVDepth, statScore, statTime, statNodes, statNps, statTBHits, statHash,
|
||||||
statIsMate, statUpperBound, statLowerBound, moves));
|
statIsMate, statUpperBound, statLowerBound, moves));
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException nfe) {
|
} catch (NumberFormatException nfe) {
|
||||||
|
@ -1036,7 +1041,7 @@ public class DroidComputerPlayer {
|
||||||
pvModified = false;
|
pvModified = false;
|
||||||
}
|
}
|
||||||
if (statsModified) {
|
if (statsModified) {
|
||||||
listener.notifyStats(id, statNodes, statNps, statTBHits, statTime);
|
listener.notifyStats(id, statNodes, statNps, statTBHits, statHash, statTime);
|
||||||
statsModified = false;
|
statsModified = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -676,6 +676,7 @@ public class DroidChessController {
|
||||||
private long currNodes = 0;
|
private long currNodes = 0;
|
||||||
private int currNps = 0;
|
private int currNps = 0;
|
||||||
private long currTBHits = 0;
|
private long currTBHits = 0;
|
||||||
|
private int currHash = 0;
|
||||||
private int currTime = 0;
|
private int currTime = 0;
|
||||||
|
|
||||||
private boolean whiteMove = true;
|
private boolean whiteMove = true;
|
||||||
|
@ -760,6 +761,9 @@ public class DroidChessController {
|
||||||
}
|
}
|
||||||
statStrTmp.append(String.format(Locale.US, " tb:%d%s", tbHits, tbHitsPrefix));
|
statStrTmp.append(String.format(Locale.US, " tb:%d%s", tbHits, tbHitsPrefix));
|
||||||
}
|
}
|
||||||
|
if(currHash > 0){
|
||||||
|
statStrTmp.append(String.format(Locale.US, " h:%d", currHash / 10));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
final String statStr = statStrTmp.toString();
|
final String statStr = statStrTmp.toString();
|
||||||
final String newPV = buf.toString();
|
final String newPV = buf.toString();
|
||||||
|
@ -842,10 +846,11 @@ public class DroidChessController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void notifyStats(int id, long nodes, int nps, long tbHits, int time) {
|
public void notifyStats(int id, long nodes, int nps, long tbHits, int hash, int time) {
|
||||||
currNodes = nodes;
|
currNodes = nodes;
|
||||||
currNps = nps;
|
currNps = nps;
|
||||||
currTBHits = tbHits;
|
currTBHits = tbHits;
|
||||||
|
currHash = hash;
|
||||||
currTime = time;
|
currTime = time;
|
||||||
setSearchInfo(id);
|
setSearchInfo(id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,13 +32,14 @@ public interface SearchListener {
|
||||||
long nodes;
|
long nodes;
|
||||||
int nps;
|
int nps;
|
||||||
long tbHits;
|
long tbHits;
|
||||||
|
int hash;
|
||||||
boolean isMate;
|
boolean isMate;
|
||||||
boolean upperBound;
|
boolean upperBound;
|
||||||
boolean lowerBound;
|
boolean lowerBound;
|
||||||
ArrayList<Move> pv;
|
ArrayList<Move> pv;
|
||||||
String pvStr = "";
|
String pvStr = "";
|
||||||
|
|
||||||
public PvInfo(int depth, int score, int time, long nodes, int nps, long tbHits,
|
public PvInfo(int depth, int score, int time, long nodes, int nps, long tbHits, int hash,
|
||||||
boolean isMate, boolean upperBound, boolean lowerBound, ArrayList<Move> pv) {
|
boolean isMate, boolean upperBound, boolean lowerBound, ArrayList<Move> pv) {
|
||||||
this.depth = depth;
|
this.depth = depth;
|
||||||
this.score = score;
|
this.score = score;
|
||||||
|
@ -46,6 +47,7 @@ public interface SearchListener {
|
||||||
this.nodes = nodes;
|
this.nodes = nodes;
|
||||||
this.nps = nps;
|
this.nps = nps;
|
||||||
this.tbHits = tbHits;
|
this.tbHits = tbHits;
|
||||||
|
this.hash = hash;
|
||||||
this.isMate = isMate;
|
this.isMate = isMate;
|
||||||
this.upperBound = upperBound;
|
this.upperBound = upperBound;
|
||||||
this.lowerBound = lowerBound;
|
this.lowerBound = lowerBound;
|
||||||
|
@ -66,7 +68,7 @@ public interface SearchListener {
|
||||||
public void notifyPV(int id, Position pos, ArrayList<PvInfo> pvInfo, Move ponderMove);
|
public void notifyPV(int id, Position pos, ArrayList<PvInfo> pvInfo, Move ponderMove);
|
||||||
|
|
||||||
/** Report search statistics. */
|
/** Report search statistics. */
|
||||||
public void notifyStats(int id, long nodes, int nps, long tbHits, int time);
|
public void notifyStats(int id, long nodes, int nps, long tbHits, int hash, int time);
|
||||||
|
|
||||||
/** Report opening book information. */
|
/** Report opening book information. */
|
||||||
public void notifyBookInfo(int id, String bookInfo, ArrayList<Move> moveList);
|
public void notifyBookInfo(int id, String bookInfo, ArrayList<Move> moveList);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user