public void update_state()
   {
      ArrayList<Agent> agentcopy = new ArrayList<Agent>(agents);
      Iterator it = agentcopy.iterator();
      while(it.hasNext())
      {
         Agent a=(Agent)it.next();
         a.update();
         if(a.removable())
         {
            agent_grid[a.getX()][a.getY()] = null;
            agents.remove(a);
            
         }
      }
      
      ArrayList<Sugar> sugarcopy = new ArrayList<Sugar>(sugar);
      it = sugarcopy.iterator();
      while(it.hasNext())
      {
         Sugar a=(Sugar)it.next();
         a.update();
         if(a.removable())
            sugar.remove(a);
      } 
      
   }