# Decision-making system

The system uses scoring to determine the best behavior. Let's look at the example here. Our AI has a direct line of sight with the enemy, as well as being attacked by an enemy. \
Input variables:

| Decision parameters                                                                                                                                     | Decision name                            | Decision score                      |
| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- | ----------------------------------- |
| <p><mark style="color:red;">Has</mark> <mark style="color:blue;">active target</mark>= true <br><mark style="color:red;">Under attack</mark> = true</p> | <mark style="color:purple;">Alert</mark> | <mark style="color:green;">4</mark> |
| <p><mark style="color:red;">Have search targets</mark> =true<br><mark style="color:red;">Someone else needs help</mark>= false<br></p>                  | <mark style="color:purple;">Ready</mark> | <mark style="color:green;">1</mark> |
| <mark style="color:red;">Can patrol</mark> =false                                                                                                       | <mark style="color:purple;">Calm</mark>  | <mark style="color:green;">0</mark> |

<figure><img src="https://1732704790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8NeAffCvPebTKR2CvQJ0%2Fuploads%2FjE5VwnCb6IJBCmk5pKnQ%2FStatus.png?alt=media&#x26;token=2d4e71f7-d091-41c9-a22a-d8e7c824dbc5" alt=""><figcaption></figcaption></figure>

Since <mark style="color:purple;">alert</mark> status returns the highest score, this is the score that's going to be chosen by the system.&#x20;
