Using a fuzzy logic for decision making
Fuzzy logic presents a way to move from exact reasoning of Boolean logic to an approximation of a truth value, whereas Boolean logic uses a binary set of true or false values; fuzzy logic can operate anywhere between these two values.
This can be used to deal with situations where you can't be 100 percent sure about the result. Many modern games use this to make autonomous NPCs or intelligent enemies that can accommodate their actions to the current situation or environment.
This recipe will use a simplistic version of the fuzzy inference system with a fixed number of value points. It's not as precise as the professional grade fuzzy inference systems, but still performs well enough to be used in games.
The FIS solver is designed in a way to make its configuration as simple as possible.
Fuzzy sets are often used with neural networks, mainly because neurons operate on various levels at synapses.
Getting ready
First, you'll need to prepare a special version...