Both sides previous revisionPrevious revisionNext revision | Previous revision |
ulam:demos:coevolution [2015/10/14 11:46] – [How the video was made] ackley | ulam:demos:coevolution [2017/08/15 03:58] (current) – ackley |
---|
Evolution can sometimes be seen as occurring between a population of creatures and a fixed environment. Some creatures do better than others and proliferate, and over time a population emerges that is increasingly well-adapted to that environment. Then further innovations typically become smaller and rarer and the system's dynamics tends toward a fixed point. | Evolution can sometimes be seen as occurring between a population of creatures and a fixed environment. Some creatures do better than others and proliferate, and over time a population emerges that is increasingly well-adapted to that environment. Then further innovations typically become smaller and rarer and the system's dynamics tends toward a fixed point. |
| |
But just as often, the "environment" is a moving target, because it contains //other populations// of creatures that are //also// evolving. In such circustances the resulting //coevolutionary// system dynamics can quite complex, as the evolutionary innovations of one species are countered by evolutionary counter-innovations by another species. | But just as often, the "environment" is a moving target, so solutions that worked in the past may no longer work as well as time passes. This can happen because of purely external factors like a meteor hitting the planet, or because of the effects of the evolving population's actions --- or, and this is our present concern, because the environment contains //other populations// of creatures that are //also// evolving. In such circumstances the resulting //coevolutionary// system dynamics can be quite complex, as the evolutionary innovations of one species are foiled by the evolutionary counter-innovations of another species. |
| |
In 2002, Dave Ackley developed a project called //Huegene// for a C++ programming course. The coevolutionary model demonstrated here is a variation of the original //Huegene//, using RGB color encoding while the original used HSV. (Also, perhaps ironically, the primary pedagogical purpose of //Huegene// was to learn about discrete event simulation, but that is all part of the fundamental machine architecture in ULAM and the MFM, Huegene in ULAM is a //much// smaller project than it was in C++!) | In 2002, Dave Ackley developed a coevolution simulation project called //Huegene// for a C++ programming course. The ULAM Huegene model demonstrated here is a variation of the original //Huegene//, differing in several ways including using an RGB color encoding where the original used HSV. (Also, perhaps ironically, the primary pedagogical purpose of //Huegene// was to learn about discrete event simulation, but in the MFM, all issues of event scheduling and selection are built into the fundamental architecture, Huegene in ULAM is a //much// smaller project than it was in C++!) |
| |
===== The Huegene model ===== | ===== The Huegene model ===== |
| |
Suppose there are two species of creatures, the //Plants// and the //Herbivores//, existing in a two-dimension grid of sites that each can hold one creature. Plants are immobile, but they spontaneously grow over time and will split into empty adjacent sites if they are large enough. The Herbivores move randomly and attempt to eat any Plants they stumble over. Herbivores must eat enough Plants to avoid starving to death, and if they accumulate enough energy they can produce an offspring Herbivore in a neighboring empty site. | Suppose there are two species of creatures, the //Plants// and the //Herbivores//, existing in a two-dimensional grid of sites that each can hold one creature. Plants are immobile, but they spontaneously grow over time and will split into empty adjacent sites if they are large enough. The Herbivores move randomly and attempt to eat any Plants they stumble over. Herbivores must eat enough Plants to avoid starving to death, and if they accumulate enough energy they can produce an offspring Herbivore in a neighboring empty site. |
{{ youtube>jQaXtbrVNaU?medium|Plant vs Herbivore}} | {{ youtube>jQaXtbrVNaU?500x280|Plant vs Herbivore}} |
| |
The Plants have genetic information that allows them to appear as any (24 bit RGB) color. Any given Plant has a fixed color for its whole lifetime, but if it manages to produce an offspring Plant, the child's color will be slightly modified -- "mutated", completely at random -- compared to the parent. Regardless of their color, all //Plants// are equally efficient at growing and having offspring plants, and so on -- in a world consisting only of //Plants// their colors are completely irrelevant to their evolutionary success. | The Plants have genetic information that allows them to appear as any (24 bit RGB) color. Any given Plant has a fixed color for its whole lifetime, but if it manages to produce an offspring Plant, the child's color will be slightly modified --- "mutated", completely at random --- compared to the parent. Regardless of their color, all //Plants// are equally efficient at growing and having offspring plants, and so on --- in a world consisting only of //Plants// their colors are completely irrelevant to their evolutionary success. |
| |
For their part, the //Herbivores// also have a genetically-specified color, that determines what color Plants they are most likely to eat successfully. So a "well-adapted" Herbivore will have a color closely matching that of the nearby Plants, while a "well-adapted" Plant will have a color that's far (in the absolute distance in RGB) from the nearby Herbivores. | For their part, the //Herbivores// also have a genetically-specified color, that determines what color Plants they are most likely to eat successfully. So a "well-adapted" Herbivore will have a color closely matching that of the nearby Plants, while a "well-adapted" Plant will have a color that's far (in terms of the sum of absolute differences in RGB) from the nearby Herbivores. |
| |
If we put a single Plant into an empty grid, it will gradually produce a population of Plants around it, with increasingly mutated colors the further we get from the original "Ancestor". What will happen if we then start dropping Herbivores near the Plant population, until we get one that "catches" -- that can eat the available Plants successfully enough to produce offspring? | If we put a single Plant into an empty grid, it will gradually produce a population of Plants around it, with increasingly mutated colors the further we get from the original "Ancestor". What will happen if we then start dropping Herbivores near the Plant population, until we get one that "catches" --- that can eat the available Plants successfully enough to produce offspring? |
| |
| The video at right shows one possible result, run in the MFM simulator for several hours of real time and displayed so that about 90 events happen at each site during each second. |
| |
The video at right shows one possible result, run for several hours of real time and displayed so that about 90 events happen at each site during each displayed second. | |
===== ULAM source code ===== | ===== ULAM source code ===== |
| |
*/ | */ |
element Plant { | element Plant { |
typedef Plant Self; | |
typedef Unsigned(8) Channel; | typedef Unsigned(8) Channel; |
typedef Channel ARGB[4]; | typedef Channel ARGB[4]; |
*/ | */ |
element Herbivore { | element Herbivore { |
typedef Herbivore Self; | |
typedef Unsigned(8) Channel; | typedef Unsigned(8) Channel; |
typedef Channel ARGB[4]; | typedef Channel ARGB[4]; |