Permalink
Browse files

Final parameters set

  • Loading branch information...
joesweeney committed May 2, 2017
1 parent 25feb38 commit 1c14746c37ae2347b4c91849a534fcb2d3ad4f24
Showing with 11 additions and 6 deletions.
  1. +3 −0 src/CheckersAI.java
  2. +8 −6 src/RmCheckersClient.java
View
@@ -56,6 +56,9 @@ public Move minimax(CheckersGameState s, int min_ply){
double check;
Move max = null;
for(Move a: s.actions()){
+ if(s.actions().size() == 1) {
+ return a;
+ }
check = minValue(s.result(a), alpha, beta, depth + 1, a.isJump(), min_ply);
if(check > v){
v = check;
View
@@ -55,7 +55,7 @@
public RmCheckersClient(){
_socket = openSocket();
//e = new Evaluator00();
- e = new BaseEvaluator("weights/beta-history.csv");
+ e = new BaseEvaluator("weights/beta.csv");
endEval = new EndEvaluator("../src/weights/endbeta.csv");
currentState = new CheckersGameState3();
user = _user1;
@@ -152,10 +152,10 @@ public static void main(String[] argv){
}
public void playGame(int player) {
- int minPly = 10;
- int maxPly = 13;
+ int minPly = 8;
+ int maxPly = 8;
boolean switched = false;
- int time = 180;
+ int time = 150;
try {
String msg = readAndEcho(); // initial message
if(player == 1) { // black
@@ -170,7 +170,9 @@ else if(player == 2) { // white
if(currentState.isEndGame() && !switched){
minPly = maxPly;
switched = true;
- ai.eval = endEval;
+ if(currentState.pieceRatio(player) < 0.5){
+ ai.eval = endEval;
+ }
}
if(time < 30) {
minPly = 8;
@@ -194,11 +196,11 @@ else if(player == 2) { // white
break;
}
msg = readAndEcho(); // move query
- time = parseTime(msg);
if(msg.contains("Result")) {
System.out.println("Done.");
break;
}
+ time = parseTime(msg);
}
} catch (IOException e) {
System.out.println("Failed in read/close");

0 comments on commit 1c14746

Please sign in to comment.