Пример #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();
     }
   }
 }
Пример #2
0
 public void update() {
   super.update();
   subgoalAchieved = objectiveTracker.check();
 }
Пример #3
0
 @Override
 public void reset() {
   super.reset();
   objectiveTracker.reset();
   objectiveTracker.highlight();
 }
Пример #4
0
 @Override
 public void reset() {
   super.reset();
   uneatenFood.clear();
   uneatenFood.addAll(allFood);
 }