<- rotate([a,b],[15, -30]); !!move.

The agent has a goal `!move`, which it at all times will pursue. The first line says that if it has perceived light values from two distinct sensors, and they indicate that the robot is on the line, then it should move forward. The second and third line are the cases where the agent is about to leave the line and must turn to avoid this. The two cases corresponds to the line turning left and right, respectively.

It must be noted that in order to successfully follow lines, the robot must move very slowly forward, so that it is able to react to percepts before it is too late (i.e. before it has moved completely away from the line). This imples that communcation is a greater bottleneck than initially suspected.

The implementation assumes that the agent initially is placed on the line, and the result may otherwise be unpredictable. However, given that assumption, the entire implementation can be done in three lines.

Communication {#communication-1}
-------------

In the second case study I consider two agents: One with a light sensor, an ultrasonic sensor and two motors – the “obstacle finder” and one with only a light 