Of course we have. Researchers in Switzerland designed an experiment in which small robots were programmed with a basic artificial intelligence and set loose in a room filled with either “food” or “poison.” Robots were rewarded with points if they found the food and stayed near it. Here’s the thing, though: the robots were equipped with lights that the other robots could detect, which they would randomly flash, resulting in many flashes near the food, where most of them were gathering. The robots would be drawn to these areas when they learned that the others were surrounding the food.
However, subsequent “generations” of robots, created when the researchers copied the artificial "neural" networks of the most successful ones, eventually learned that if they attracted other robots to the food, they would risk overcrowding the area and being jostled out. As a result, they got to the point where they learned to never flash their light when they were near the food, so as to keep it for themselves.