private functions

I’m on a roll now, with a second abstract class, this time to handle the breeding of creatures. I’ve kept it general, so it could be used for other genetic algorithm sketches.

One method, for the first generation, returns a string of random 1s and 0s, while another (still to be tested) accepts two ‘parents’ and breeds them, with an optional chance of mutation. I’ve also moved some functions, such as building the webs out of the DNA, into the web class and made them private so they can’t be accessed from outside. It’s all looking a lot more organised and controlled.

Tags: , ,

Thursday, August 19th, 2010 coding

Leave a Reply