Crossover Errors and Scoring Edits 02/21/2018


Now that mutation has been successfully implemented, it is time to start on crossover. This process will allow us to merge existing cells that score well, with other cells that score well. Hopefully this will produce better automata over time.

Here, I let the mutate++ button that mutates 10 at a time become just plain mutate, and add a crossover function.

Progress on crossover has been made, and currently the program can easily do the following things:

  • Swap dead & alive values

Since dead and alive are both essentially the same, swapping with these two maps was a breeze. Right now, dead and alive will swap four values with another dead and live map.

  • Swap seeds

Seeds will swap 35% of the smallest seed map with each other. Previously, mutate did not touch the seeds of a cell. However, it was discovered implementing this that when mutate does not change the seeds a lot of duplicates begin to appear. Therefor, mutate was edited to randomize new seeds.

  • Swap colors

Color also operates under this 50% of the smallest color map. This doesn’t mean half the colors will be swapped, the scenario where half the colors will be swapped only occurs when the smaller map is the one being returned. Larger maps will have a smaller percentage of themselves changed.

Unfortunately, when implemented I start running into a lot of NullPointer exceptions, this meant that somewhere, something was getting lost. Furthermore, a problem in merging seeds could clearly be seen, and extended into the logic of how they were merged.

As you can see here, seed merges are only affecting part of the graph, since we don’t exceed values from the smaller graph. Hopefully, by re-implementing this function to add seeds to the smaller graph instead of swap

It turned out to be a couple things:

  • mergeSeeds and mergeColors had that potential to assign a “null” values to some of their maps. This was due to not checking whether certain maps of different sizes even could swap with each other. It was fixed by adding a max to each function.
  • mergeSeeds old check to make sure to avoid nullpointers was out of wack, and made it so only a percentage of the graph was moved over.

Unfortunately, even the new implementation of mergeSeeds is wonky. Because of different sized graphs, you can clearly see where the function stops merging in some instances.

Here you can see where seed graphs with a different make-ups have gotten merged. Suddenly half the image has noticeably less or more seeds than the other half.

When implementing the error-free crossover this error continues to persist, and gives us cellular automata’s like the ones below.

Interestingly enough, this error doesn’t always persist in our automata’s, and sometimes produces normal looking automata’s like the one below.

However, the problem is so common that it affects a good portion of our automata’s. I should be able to fix this tomorrow in our Monday meeting though, so for now I will move on to making edits to the scoring metric and coming up with a new hypothesis.

Scoring Edits

Talking with the professor yielded some insight on how to truly parse through some of my confusing results.

It is safe to say from the results that my original hypothesis was incorrect.

The last part of the survey was designed in case this was the case, and looking at it I can extrapolate some information that might be helpful in helping me form a new hypothesis.

These two images were rated similarly, with the right being rated only slightly higher than the left.

This tells us that people enjoy:

  • A variety of shapes
  • Asymmetry

Similarly, our sample group answered that they preferred similar color schemes.

From here we can develop a new hypothesis.


30 degree rule
Colors should be considered the best if they are 30 degrees apart. However, if they are less than 30 degrees apart that should auto-zero. This ensures they do not look like the same color, while also being similar.
New ideal
From the golden rule we can say that two big shapes is ideal, but from this image we can say that seven medium shapes is ideal. This blurs the line between big and medium, since perfection is not achievable. However, it should encourage more large/medium shapes to form in general.


Adjusting the rules according to my above hypothesis resulted in two interesting images that very well demonstrate the above concepts.

I ran the program to produce 50 images, out of these images one scored the highest according to the color scale, and the other scored the highest according to the shape scale.

With a color score of 0.348, this image had the highest color score of the bunch. It also correctly demonstrates a similar color scheme. To add to that, this image was also rated the best overall
With a score of 0.5625 this image rated the best in regards to shapes. As you can see, it certainly has formed a lot of big shapes across the picture.




Analyzing Data

Briefly I will touch on what analyzing the data from the first 10 images produced resulted in.

Test Significance
The boxes represent where scores had significant overlap, and mean that people viewed the automata’s similarly. The winner was indeed 5.48. However it also means that the winner was lumped in with the second lowest (but not purposefully bad) score

In my opinion, the computer is doing a good job at identifying potentially good automata’s, but maybe not a good job at correctly scoring the top few.


  • Fix crossover
  • Fix automata names
  • Discuss printing option and look into funding request as team

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s