Beispiel #1
0
 public void update() {
   super.update();
   subgoalAchieved = false;
   reward = 0.0;
   for (Iterator<Food> i = uneatenFood.iterator(); i.hasNext(); ) {
     Food f = i.next();
     if (mouth.getShape().contains(f.getPosition().toPoint2D())) {
       i.remove();
       f.warp();
       subgoalAchieved = true;
       reward += f.getValue();
     }
   }
 }
Beispiel #2
0
 public void update() {
   super.update();
   subgoalAchieved = objectiveTracker.check();
 }
Beispiel #3
0
 @Override
 public void reset() {
   super.reset();
   objectiveTracker.reset();
   objectiveTracker.highlight();
 }
Beispiel #4
0
 @Override
 public void reset() {
   super.reset();
   uneatenFood.clear();
   uneatenFood.addAll(allFood);
 }