Fixed various errors when target = 0.
This commit is contained in:
@@ -44,7 +44,7 @@ public class AdaptiveComPlayer implements Player {
|
||||
// take 10 turns to place 6 tiles
|
||||
double defaultPenalty = -0.25;
|
||||
|
||||
int maxScore = target.getTargetScore();
|
||||
int maxScore = Math.max(1,target.getTargetScore());
|
||||
int maxTiles = Board.NUM_COLS * Board.NUM_ROWS;
|
||||
|
||||
gw = GridWorldFactory.createGridWorldForTileGame(maxTiles,
|
||||
@@ -79,10 +79,11 @@ public class AdaptiveComPlayer implements Player {
|
||||
if (action == null || state == null) {
|
||||
System.out
|
||||
.println("Board state outside of parameters of MDP. Reverting to failsafe behavior.");
|
||||
action = GridWorldAction.RandomMove;
|
||||
}
|
||||
action = GridWorldAction.AddTile;
|
||||
} else {
|
||||
System.out.println("Performing action " + action + " at state " + state
|
||||
+ " per policy.");
|
||||
}
|
||||
switch (action) {
|
||||
case AddTile:
|
||||
// System.out.println("Performing action #" +
|
||||
|
||||
Reference in New Issue
Block a user