The goal for this project was to create Artificial Intelligence pilots who use Fuzzy Logic to make decisions as to what actions should be taken in order to safely land an airplane.
The application uses a web worker for each pilot/aircraft. The web worker is used to compute the fuzzy logic, so the UI can remain responsive. The current state of the air traffic is drawn using a canvas element. Each pilot knows only where they want to go next, and what aircraft are nearby. With this information, each pilot uses fuzzy logic to determine how it's heading, airspeed and altitude need to be adjusted.
With traditional logic, we can have an answer of only 1 or 0 (True or False), but with fuzzy logic, we can have an answer anywhere from 1 to 0 (Somewhat True, Very False, etc...). With fuzzy logic, we can input various factors, and instead of getting a fixed answer, we get a fuzzy answer.
Example 1: need to descend (descend) + aircraft underneath (climb) = maintain current altitude.
Since we use fuzzy logic, the distances will have an impact:
Example 2: need to descend very much (descend very much) + aircraft far underneath (climb a little) = descend a little.