public boolean act( Agent agent, Action action ){
    if( energy_level <= 0 ){
      agent.die();
      updateViews(msg);
      return false;
    }
    boolean flag = (action != null);
    if( flag ){
      SimulatedAgent a = (SimulatedAgent) agent;
      int x = ( (Integer) a.getAttribute(X)).intValue();
      int y = ( (Integer) a.getAttribute(Y)).intValue();
      Percept p = sense(a);
      String msg = null;
      String act = action.getCode();
      int actionID = language.getActionIndex(act);
      switch (actionID) {
        case 4: // eat
          if ( ( (Boolean) p.getAttribute(language.getPercept(5))).booleanValue()) {
            // @TODO: Update the perception goodness
            structure[x][y] |= (1<<15);
            int bit_flag = (1<<10);
            if( (structure[x][y] & bit_flag) == bit_flag ){
              System.out.println("Eating good food...");
              energy_level = Math.min( energy_level + INC_ENERGY_LEVEL, MAX_ENERGY_LEVEL );
            }else{
              System.out.println("Eating bad food...");
              energy_level = Math.max( energy_level - DEC_ENERGY_LEVEL, 0 );
            }
          }
          else {
            msg = SimpleView.ERROR +
                "[There is not food. Eat action not executed]";
          }
          updateViews(msg);
          break;
        default:
          if( actionID == 2 ){
            energy_level--;
            System.out.println( energy_level );
          }
          super.act(agent, action);
          break;
      }
    }
    return flag;
  }