@@ -164,3 +164,80 @@ For the first experiment with only cruise active, we observed a very simple beha
As an addition we tested the robot with Avoid and Cruise active. Here the robot drove straight ahead in a slight curve, ignoring light conditions. When encountering an object with the ultrasonic sensor, the robot compared distances and turned towards the direction where the distance is longest.
## Exercise 3: Add an escape behavior
#### Task:
In the Figure 9.9 the top priority behavior is Escape. An implementation of Escape in IC is given on page 305 of [2].
Implement the Escape behavior in the RobotFigure9_9.java program.
#### Plan:
We impelemented the escape behavior as suggested by Jones, Flynn & Seiger [3].
```
import lejos.nxt.*;
import lejos.util.Delay;
class Escape extends Thread
{
private SharedCar car = new SharedCar();
private int power = 70, ms = 500;
TouchSensor touchLeft = new TouchSensor(SensorPort.S2);
TouchSensor touchRight = new TouchSensor(SensorPort.S3);