Пример #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;
 }