private void updateEnvironment(Graphics g) {
        // see if application is paused
        if (running) {
            drawFood(g);
            drawFeeders(g);
            // loop through all food and feeders
            for (Food fd : FoodCollection.getFoods()) {
                // make sure the food is still active
                if (fd.isActive()) {
                    for (Feeder fr : FeederCollection.getFeeders()) {
                        // if the feeder "sees" the food, react to it.
                        if (fd.isPerceived(fr)) {// &&
                                //!fr.getObservedFood().contains(fd)) {
                            fr.reactTo(fd);
                        }
                    }
                }
            }
            // update all of the feeders
            for (Feeder fr : FeederCollection.getFeeders()) {
                fr.update();
            }
                  
            // if the generation loop count is the same as the number of generation
            //  loops until the next generation, advance the generation
            if (++genLoopCount == numGenLoops) {
                advanceTheGeneration();
                // make sure we reset the loop counter
                genLoopCount = 0;
            }
        }
        // repaint the component
        repaint();
    }