Genetic Random Number Guessing Agent (GRNGA)
No, its not as fancy as the title suggested. It doesn't even work yet, which is why I posted here. :rolleyes:
What it does: It is an introduction to programming Genetic AI for myself. It is supposed to take in a number from the user, and then 'evolve' a way to add 5 numbers that will result in the given number.
How it does it: A class 'Chromosome' contains 5, in the beginning, randomly generated numbers and a fitness rating based on how close to the target number the sum of those 5 numbers are.
I start out with a 'population' of 100 Chromosomes, among which the 50 Chromosomes closest to the target are singled out and allowed to 'mate'. They are then put together in pairs and in those pairs combine their numbers into new chromosomes. The old chromosomes are then deleted and the new ones become the new generation. This continues until a chromosome has come up with a correct solution.
Why it doesn't do it: My worst nightmare, Segmentation fault...
I spent 4 hours yesterday trying to figure out the reason for this.
I haven't got a clue as to what could be causing it... Any help is greatly appreciated.
If something in the description was too fuzzy (I came directly from working on a Fuzzy Logic AI :D ) just ask!