Thread: Genetic Random Number Guessing Agent (GRNGA)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2004
    Posts
    10

    Unhappy 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.

    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 ) just ask!
    Last edited by Keybone; 05-27-2004 at 01:23 AM.
    #include "Sig.h"
    #ifndef noob
    #define noob keybone
    #endif

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. random number problems
    By lespaul5895 in forum C Programming
    Replies: 3
    Last Post: 07-05-2007, 02:16 AM
  2. Random number + guessing game trouble
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-08-2007, 03:33 AM
  3. Generating a random number?
    By Konspiracy in forum C++ Programming
    Replies: 5
    Last Post: 04-28-2007, 12:33 AM
  4. How do I restart a random number sequence.
    By jeffski in forum C Programming
    Replies: 6
    Last Post: 05-29-2003, 02:40 PM
  5. random number
    By mrukok in forum C++ Programming
    Replies: 7
    Last Post: 03-16-2003, 08:04 PM