@@ -103,4 +103,25 @@ As the program was executed we observed the following (Fig.5):
[](http://www.youtube.com/watch?v=Lsahzi8ipL4)
##### Fig.5 - Observed behavior in a closed alley.
The robot drives through a closed alley. When the robot meets the dead end, and can't find space in any direction it makes a u-turn and drives in the opposite direction.
\ No newline at end of file
The robot drives through a closed alley. When the robot meets the dead end and cannot find space in any direction it makes a u-turn and drives in the opposite direction.
## Exercise 2: Behaviors as concurrent threads
#### Task:
The program RobotFigure9_9.java implements the Avoid, Follow and Cruise behaviors and the arbitration mechanism suggested on page 306 in [2]. Download the program and observe the car. Describe how the car behaves. Try to describe the conditions that trigger the different behaviors.
#### Plan:
The RobotFigure9_9.java was executed without changes and the test was conducted in a darkened room. The robot's goal was to measure light values in directions left and right, and drive in the direction with most light (the door).
#### Results:
The robot was placed a few metres from the door. The video (Fig 6) shows the robot turning left and right in order to measure light values to it's sides. It then compares the values and drives towards the door as this area emits most light.
[](http://www.youtube.com/watch?v=MUuwSy8rngo)
##### Fig.6 - Observed behavior in a darkened room.