@@ -0,0 +1,1901 @@
+/*%0A%0AProgrammers: Kris Larson%0A%0ADescription: A memory structure for the robot. It's%0A   retrieve method can find the closest learned energy%0A   source to the robot.%0A%0A*/%0A%0Aimport java.awt.Point;%0Aimport java.util.Random;%0Aimport java.util.LinkedList;%0A%0Apublic class ClosestStructure%3CE extends Memory%3E implements RobotMemory%3CE%3E %7B%0A   public LinkedList%3CE%3E list = new LinkedList%3CE%3E();%0A   boolean x, y;%0A%09%0A   public int forget(E episode) %7B%0A      for (int i = 0; i %3C list.size(); i++) %7B%0A         x = list.get(i).getFoodLocation().getX() == episode.getFoodLocation().getX();%0A         y = list.get(i).getFoodLocation().getX() == episode.getFoodLocation().getX();%0A         if(x && y)%7B%0A            list.remove(i);%0A   %09%09   return list.size();%0A         %7D%0A      %7D%0A%09%09list.remove(episode);%0A%09%09return list.size();%0A%09%7D%0A%0A%09public int learn(E episode) %7B%0A      int loop = list.size();%0A      if (list.isEmpty()) %7B%0A         list.add(episode);%0A         return list.size();%0A      %7D%0A      else %7B%0A         for (int i = 0; i %3C loop; i++) %7B%0A            x = list.get(i).getFoodLocation().getX() == episode.getFoodLocation().getX();%0A            y = list.get(i).getFoodLocation().getY() == episode.getFoodLocation().getY();%0A            if(x && y)%7B%0A      %09%09   return list.size();%0A            %7D%0A         %7D%0A           list.add(episode);%0A      %7D%0A      return list.size();%0A%09%7D%0A%0A%09public E retrieve(double probability, Point robotPosition) %7B%0A%09%09Random gen = new Random();%0A      double i = gen.nextDouble();%0A      %0A      if (!list.isEmpty()) %7B   %0A   %09%09if (i %3C= probability) %7B%0A   %09%09%09double dist = 200;%0A            int temp = 0;%0A   %09%09%09for (int j = 0; j %3C list.size(); j++) %7B%0A               Point place = (list.get(j).getFoodLocation());%0A   %09%09%09%09if (place.distance(robotPosition) %3C dist) %7B%0A   %09%09%09%09%09dist = place.distance(robotPosition);%0A   %09%09%09%09%09temp = j;%0A   %09%09%09%09%7D%0A   %09%09%09%7D%0A   %09%09%09return list.get(temp); //Returns Memory Object%0A   %09%09%7D%0A      %7D%0A%09%09return null;%0A%09%7D%0A%7D%0A

Create ClosestStructure.java