Skip to content

Commit

Permalink
Adjusted time management.
Browse files Browse the repository at this point in the history
  • Loading branch information
dykstrom committed Dec 25, 2018
1 parent 249cf0a commit 60ed285
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ public int findBestMove(Position position, int maxDepth) {

/**
* Finds the best move in the given position, searching in the given list of
* moves. Searching is limited to the given max depth and the given max
* time.
* moves. Searching is limited to the given max depth and the given max time.
*/
private int findBestMove(Position position, int maxDepth, int numberOfMoves, long maxTime) {
setMaxDepth(maxDepth);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/se/dykstrom/ronja/engine/time/TimeUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public static long calculateTimeForNextMove(TimeControl timeControl, TimeData ti
// Divide the remaining time between remaining moves,
// but allocate more time to moves early in the game
double partOfMovesLeft = 1.0 * timeData.getNumberOfMoves() / timeControl.getNumberOfMoves();
double factor = 0.6 * partOfMovesLeft + 0.7;
double factor = 0.2 * partOfMovesLeft + 0.9;
long evenlyDividedTime = timeData.getRemainingTime() / timeData.getNumberOfMoves();
return (long) (evenlyDividedTime * factor);
} else { // TimeControlType.INCREMENTAL
Expand Down
3 changes: 2 additions & 1 deletion src/main/scripts/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@

<h2>Version History</h2>

<h3>0.8.1 (2018-12-??)</h3>
<h3>0.8.1 (2018-12-25)</h3>
<ul>
<li>Implemented draw by threefold repetition.</li>
<li>Improved performance by replacing some lists with arrays.</li>
<li>Improved time management.</li>
</ul>

<h3>0.8.0 (2018-12-12)</h3>
Expand Down

0 comments on commit 60ed285

Please sign in to comment.