Symbiosis and toxicity

The CA is controlled by the following buttons:
Shorter: Makes CA shorter.
Longer: Makes CA longer.
Plant CA: CA is planted.

The obstacle is controlled by the following buttons:
Upward: Moves obstacle upward. Its y-coordinate is displayed as ycoord =.
Downward: Moves obstacle downward. Its y-coordinate is displayed as ycoord =.

resources= the amount of resources which the CA has.
ycoord= The y-coordinate of the obstacle

When the experiment starts a zygote is planted at  the bottom line. The CA starts moving upward  and his resources dwindle to a minimum of resources = - 49. When he reaches the obstacle the CA clings to it, incorporates it,  and its resources rise to a maximum, resources = 40. The CA stops interacting with the obstacle and continues upward. Its resources decline and it returns to the obstacle in order to replenish them. This time the interaction is toxic to the CA dies. A new zygote is planted and the cycle starts again.

Now click on ‘longer’ and observe the CA and its history.

Please observe the following:

1. Maturation: After the zygote is planted the CA matures and elongates while moving upward. When matured it oscillates around its center of mass and reached its solution, or attractor.
2. Memory: The CA remembers where it was heading before meeting the obstacles and continues in the same direction after leaving it.
3. The effect  of the obstacle on the CA depends on the direction from which the CA approached it. If approaching it from below the contribution of the obstacle was beneficial, while if approaching the obstacle from above, interaction was toxic.
4. The obstacle is a zygote which is formed and killed at every time step. When interacting with the CA it is incorporated into it.
5.Perturbation: When moving, the CA oscillates around its center of mass (= attractor). Interaction with the obstacle initiates a perturbation. When interacting with the obstacle after moving upward the CA establishes a new solution (attractor)  which it leaves when resources > 40. When moving downward the interaction with the obstacle perturbs the CA and kills it.

Now change ycoord, then plant a CA and watch what happens