Vous êtes sur la page 1sur 2

This is a program I made to demonstrate some basic fuzzy logic in action.

The entities use 3


attributes for fuzzy logic. Below is a brief overview of the attributes and what they effect:

Selfishness:

 How much food is taken when an entity collects food


 What an entity will do when it needs food but there is none (nothing, steal, attack)

Laziness:

 How long an entity waits before trying to get food

Heroism:

 Whether an entity will fight back to stealing or violence


 Whether an entity will help other entities in trouble

Some actions use multiple attributes to determine what will happen, which is when fuzzy logic
truly shines.

The way most of the fuzzy logic works is by checking the entities attribute value against
different ranges. Each range means a different action the entity might take. The entity checks
to see what actions it can take and then randomly selects one from the list.

Here is an example for when an entity is attacked:


The program uses an early instance of my 2D engine from the editor post.

Vous aimerez peut-être aussi