예제 #1
0
 public State(int x, int y) {
   posX = x;
   posY = y;
   for (Action a : Action.values()) {
     reward.put(a, 0.0);
   }
 }
예제 #2
0
 public double maxReward() {
   if (staticAction != null) {
     return staticReward;
   }
   double max = 0;
   for (Action a : Action.values()) {
     if (max == 0 || reward.get(a) > max) {
       max = reward.get(a);
     }
   }
   return max;
 }
예제 #3
0
 public Action maxAction() {
   if (staticAction != null) {
     return staticAction;
   }
   Action max = null;
   for (Action a : Action.values()) {
     if (max == null || reward.get(a) > reward.get(max)) {
       max = a;
     }
   }
   if (reward.get(max) <= 0) return null;
   return max;
 }