Making decisions with goal-oriented behaviors
Goal-oriented behaviors are a set of techniques aimed to give agents not only a sense of intelligence, but also a sense of free will once a goal is defined and given a set of rules to choose from.
Imagine we’re developing a trooper agent that need not only reach a goal of capturing the flag (main goal), but also while taking care of their own life and ammo (inner goals for reaching the first). One way of implementing it is to use a general-purpose algorithm for handling goals, so the agent develops something similar as free will.
Getting ready
We will learn how to create a goal-based action selector. Such a selector chooses an action, considering the main goal, avoiding unintentional actions with disrupting effects, and taking an action’s duration into account. Just like the recipe in the preceding section, this requires the modeling of goals in terms of numerical values.
How to do it...
Along with the action chooser, we will create base classes...