This week I focused on creating the evolutionary crossover method. A crossover method needs to take information from one parent robot, information from another parent robot, and swap that information. This mutates our robots without losing information which is what the regular mutation method does. The regular mutation method (changing constants, changing motor directions, adding information pathways, etc) destroys data whereas crossover moves data to a new robot. A different robot may be able to use the data from another in a better way.
The process of coding the crossover method was complicated. We decided to crossover our robots starting at choosing a sensor. For a chosen sensor, the robots would switch their information pathways attached to that sensor. I’ll be calling a connection between a sensor, threshold process, AltController process, MotorController process, and MotorFinal process a ‘branch’. This crossover implementation is much like two of our mutation options: adding and removing a random branch. In crossover, I needed to remove one or more branches (depending on how many branches are connected to the chosen sensor) from the two robots and add them to the opposite robot.
My first attempt at writing this method did not turn out so well. As I started writing, I realized I needed to worry about more and more channel connections and processes. The main problem was remembering to delete the old information signal channels from each process and add new channels that were created. Each test of the method would leave channels talking to empty space or process floating by themselves. Eventually, we were able to create a working method after writing some pseudo-code. Learning to write the pseudo-code first has become very handy.
Before the weekend, we were able to run one test of our new crossover method.
This graph shows the scores for 5 trials using a population size of 12 robots running for 20 generations (That’s 240 simulations). Trial 1 was able to get its score to get much lower (which is better) than the rest of the trials. This trial created robots which were able to navigate into the island room of the arena, a room which gives the robot a very good score boost because it’s a difficult room to access. So this trial started selecting robots that got into that room, however, as I watched the robots, they were never able to get out of the room. This may mean we need to change how we mutate the robots so they can learn to escape the room, or change the scoring metric.
All of the other scores in the trials fell as well, meaning all of the robots started doing better eventually. We need to run more experiments with crossover and mutation combined to find out what the best combination of methods and variables is.