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