Zachary A Porter
Create my own version of what I would consider AI through genetic development of an alogrithm rather than through evolution of a neural network.
The program is a simple genetic algorithm that attemps to maximize the number of "gates" that it passes through in a set amount of time. In each generation, 75 contenstants are created from the previously best performing 5. These contestants then compete within the time limit and a new 5 are generated. This proceeds for the number of generations requested.
So how does the thinking really work?
This program generates algorithms, not neural nets. To control a car, it follows that two algorithms are needed. One to steer and the other to control the speed of the car. Each are given the same inputs which are:
0: currentSpeed
1: currentHeading
2: distance to the nearest wall at heading - 90 degrees
3: distance to the nearest wall at heading - 15 degrees
4: distance to the nearest wall at heading degrees
5: distance to the nearest wall at heading + 15 degrees
6: distance to the nearest wall at heading + 90 degrees
7: Empty bank (0)
This data is then fed into an algorithm which at each step has a number of options. Namely: it can either add (ADD), subtract (SUB), multiply (MUL), or divide (DIV) each of the banks by a constant or it can do any of the previous operations using one of the other banks as an input.
These memory slots are then summed and the result is used to determine the angular and linear acceleration of the car.
Example:
[Log] Total best score: 58
[Log] Forward algorithm:
[Log] Thought Process:
Op0 memory 0 MUL 1.9909918461400171
Op1 memory 6 SUB 1.0044959492837375
Op2 memory 6 SUB param 0.0
Op3 memory 0 DIV param 6.0
Op4 memory 5 ADD 3.216029925908776
Op5 memory 1 ADD 9.229154585067505
Op6 memory 4 ADD 0.9633305590034583
Op7 memory 1 DIV 0.6477050276102642
Op8 memory 1 SUB 0.09247026152972995
Op9 memory 2 MUL 0.1751055982904774
Op10 memory 1 ADD 11.179253111258982
Op11 memory 0 DIV 12.356069507922896
[Log] Turn algorithm:
[Log] Thought Process:
Op0 memory 0 SUB param 3.0
Op1 memory 6 ADD 0.011786994798383129
Op2 memory 3 SUB param 0.0
Op3 memory 0 SUB 5.35517575318139
Op4 memory 3 MUL 14.351967383468132
Op5 memory 0 MUL param 3.0
Op6 memory 2 ADD param 0.0
Op7 memory 4 SUB 8.557622729657288
Op8 memory 3 ADD 5.199762634389315
Op9 memory 6 DIV 0.6158928024353526
Op10 memory 3 MUL param 6.0
Op11 memory 0 ADD param 4.0
Op12 memory 3 SUB 14.925135556501836
Op13 memory 6 MUL 1.0919596604599546
All content on this page belongs to Zachary Porter. You may use, reproduce, or modify anything from this website, provided that you give credit to zackporter.com in your usage.