next up previous contents
Next: Mating Actions Up: Actions Previous: Selecting food

Attacking Actions

There are a number of reasons why an agent may choose to `attack' another agent, that is, to deliberately cause a loss of health to that agent. Two example reasons could be to eliminate competition, or to produce food to eat. Note that this sort of reasoning isn't programmed directly into the agents, it is evolved by the agents if required. Similar to eating actions, attack actions have a type specifier and a range specifier, so one agent type may be restricted to only attack agents of another species, for example. The attack action also determines a normal distribution on how much damage the attack does to a target.

The way an agent chooses its target is rather complicated. An agent `remembers' its previous target, and attacks that agent if possible. If the previously attacked agent is out of range, or dead, or if there is no previous target, then a random target is selected from those of the correct type which are in range.

The different variants of attacking add extra side effect to the main attack action. One variant causes food to be produced if the attack results in a kill. Another causes health to be directly absorbed by the attacking agent if the attack kills the victim.


next up previous contents
Next: Mating Actions Up: Actions Previous: Selecting food
Lucas Ryan Hope
2000-11-18