Skip to content

Commit

Permalink
Strong defence and less silly moves
Browse files Browse the repository at this point in the history
  • Loading branch information
vaquierm committed Mar 20, 2019
1 parent 34212d9 commit 479ec27
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 26 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/logs/
/.idea/
/out/
*.xml

69 changes: 46 additions & 23 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/boardgame/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ public class Server implements Runnable {
protected static final String VERSION = "0.08";
protected static final int DEFAULT_PORT = 8123;

public static final int DEFAULT_TIMEOUT = 9999999;
public static final int DEFAULT_TIMEOUT = 2000;
private static final int DEFAULT_TIMEOUT_CUSHION = 1000;

public static final int FIRST_MOVE_TIMEOUT = 9999999;
public static final int FIRST_MOVE_TIMEOUT = 30000;
private static final int FIRST_MOVE_TIMEOUT_CUSHION = 1000;

protected static final String DEFAULT_BOARDCLASS = "pentago_swap.PentagoBoard";
Expand Down
2 changes: 1 addition & 1 deletion src/student_player/MonteCarloTreeSearch.java
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ else if (boardState.getWinner() == 1 - player) {
// If the opponent was able to win in one move, we should not consider this move
node.updateStatus(MonteCarloTreeNode.Status.LOSS);

if (node.getParent().getParent() == root)
if (node.getParent().getParent() == root) // If the node is a move that is directly two levels under root, the opponent could win in one turn if we play this move's parent
node.getParent().updateStatus(Status.LOSS);
}
}
Expand Down

0 comments on commit 479ec27

Please sign in to comment.