Fight or Flight?

Today we were coding our robots to make decisions. Previously, the robots took an action when an event occurred. Now we wanted them to make a choice of two actions .

The robots had to stop in front a ardboard character and decide whether to run away if it was an alien, or attack if it was human.