Naive programming is a style of coding that allows the developer to
hand-optimize the code for a particular task. NaiveAgent relies on the
hand scripting of encounters for its success - a technique frequently used in
the development of multi-player games. For each possible encounter, a script
was written specifying how the agent should react. The final program averaged
approximately fifty five percent less code than other paradigms. While the
NaiveAgent consisted of an average of fifty percent more code than grouping
agents, it contained an average of one hundred and forty four percent less code
than hard AI techniques. In the following we discuss some of the heuristics
used in the implementation:
Exploration: in the absence of other tasks, the NaiveAgent moves
around the environment with its maximum speed. This way, by covering more area,
the probability of finding food increases. It was found that the benefit of
finding more food outweights the extra expenditure of energy. The higher
coverage also increases the chance of encountering other agents, which is
beneficial, given the aggressive nature of the NaiveAgent.
|
|
Obstacle avoidance: Instead of using a sophisticated decision-making
process to guide the movement of the agent, the NaiveAgent simply moves
right every time it encounters an obstacle. To avoid getting stuck in the rut
of making repeated square movements, a failcount variable is incremented
each time the agent makes a right turn. Only encountering another agent or food
particle can reset the fail count. If the fail count is greater than five, the
direction is chosen randomly, such that the direction is not in the same
direction.
Social behavior: If the NaiveAgent has a particle of food and
another NaiveAgent is within the sensor range, only the agent with the
lowest energy level is allowed to eat.
Aggression: Whenever a different agent is detected in the sensor range,
and the agents' energy level is larger than 120% of the opponents, the
NaiveAgent attacks the opponent. If more than two agents are in the range, the
NaiveAgent attacks the weakest opponent.
|