CA foraging

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 the CA has.
ycoord= The y-coordinate of the obstacle

When the experiment starts, a zygote is planted at  the applet bottom which is the CA nest. As the CA grows it loses resources and after it matured it turns upward toward the obstacle which serves as its food. When clinging to the food source (obstacle) it creates a new solution and changes its structure. After accumulating  about 50 resource units, it turns back to explore the its nest neighborhood.  When resources become low it turns back to replenish them.

The CA may cycle several times. Yet occasionally the food acts as poison whose effect becomes apparent when the CA leaves the food source.   It then plants a new zygote and dies.

Now change the position of the food source (obstacle) and watch what happens to the CA.  There are three possible outcomes:

1. The CA reaches the food source on time and returns to its nest.
2. The CA reaches the food source yet it is toxic.  As long as it clings to the obstacle the CA lives. Yet when  turning back toward its nest   it plants a new zygote and dies.
3. When the CA cannot interact with the food source, or when it does not reach it before its resources drop below -150,   it plants a new zygote and dies.

The fate of the CA depends on the state which interacts with the obstacle:

1. In some states obstacle is food.
2. In some states obstacle is toxic.
3. Some states do not interact with the obstacle.

Toxicity is relative

Since the obstacle does not change,  toxicity depends on the CA-states which interact with it. Some states incorporate it  as food. Its incorporation by other states perturbs the CA and it dies. The same applies also to our organism. Toxicity is relative and its effect  depends on the condition of the organism, or its state.