Re: GA Newbie and some Java Code
- From: "Daniel Dyer" <"You don't need it">
- Date: Tue, 19 Dec 2006 21:27:51 -0000
On Mon, 18 Dec 2006 20:32:44 -0000, <rufuspudge@xxxxxxxxx> wrote:
My first question is, does that imply a string of all ones should be
discovered within 20 runs in the majority of cases? My code doesn't
seem to work right as it can take upwards of 700,000 runs to generate a
string of all ones. I understand that I'm not using any elitism or
other tweaks to "evolution".
700,000 sounds way too high. I haven't run your code but, looking through it, there seems to be a bug in your getParents method. You are writing to the same array that you are reading from (you have just aliased it with another reference). You probably want the possibleParents array to be a new array rather than re-using the population array. Otherwise, your selection will be self-reinforcing and potential parents will be lost at every iteration.
Dan.
--
Daniel Dyer
http://www.uncommons.org
.
- References:
- GA Newbie and some Java Code
- From: rufuspudge
- GA Newbie and some Java Code
- Prev by Date: Re: Question about wich elements are taken to the new generation
- Next by Date: Re: Parallel GAs?
- Previous by thread: GA Newbie and some Java Code
- Next by thread: Question about wich elements are taken to the new generation
- Index(es):