🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

How do you use GAs? (not a newbie question)

Started by
5 comments, last by MikeD 22 years, 11 months ago
What I mean is, what parameters do you tend to use if you implement GAs? What population sizes do you use? Do you use elitism at all, if so how much? What parent and child selection methods do you use? Tournament selection? Rank selection? What about number of parents? Do you use microbial style GAs, 2 parents or more? Do you use steady state or generational? What amount of mutation do you use? How do you implement it in terms of the amount a variable can change by a single mutation? What crossover rate do you use? Do you allow a child to be its own parent? How do you ensure smooth genotype to phenotype mapping? How many generations do you normally wait before assuming a run has reached its optimum level? Or do you not think about any of these parameters at all and just put in what seems to work? I''m really seriously interested, even if you say "nah, didn''t really care, just wapped it in". Mike
Advertisement
quote: Original post by MikeD
Do you allow a child to be its own parent?


Now that one raises a whole pile of temporal and causation questions! Care to explain what you mean by it???

Cheers,

Tim

i remember reading an article that mentioned that GA''s are an art, not a science. there isn''t really a set pattern to what is ''right'' and what is ''wrong''. you just have to experiment and see what gives you good results. if you don''t get the results you were hoping for, or don''t get them fast enough, try a different method of child selection, or tweak the mutation rate, or any of the other ways to play. that or take a good look at how you are representing your genes and evaluating their fitness. i hope this helps you see that GA''s are more of a playground and less of a predefined sequence of steps.

now, on the other hand, if you were to be more specific about what you are trying to do, i''m sure someone could suggest a preferable path for you to attempt.

cyn
Currently, I''m considering using GAs in my RTS, for planning a base to build. This is looking fairly certain, since it is something I''d like to experiment with. I might use them for planning attacks, but that is not too certain, I suppose it depends on how much I like them after the base planning

I''m not exactly sure how I am going to work the cross-breeding and mutation, but for evaluation, I think I will run a mock attack of the base and see how it stands up to it, the base set up which goes the best in these attacks will be the fittest, and the one which dies miserably... dies.
Trying is the first step towards failure.
quote: Original post by cyn
i remember reading an article that mentioned that GA''s are an art, not a science. there isn''t really a set pattern to what is ''right'' and what is ''wrong''. you just have to experiment and see what gives you good results.


Actually, GAs are VERY MUCH a science. It is simply the fact that many people using them just don''t understand the theory upon which GAs are based - and the performance nature of various operators - and hence cannot use it to aid in the efficient design of their specific implementation of the GA.

Of course, one doesn''t need to know how a drill works to be able to put a hole in a wall, but one might want to know at what speed to run the drill so that they don''t break the drill bit, given the wall type!

Cheers,

Timkin
Timkin, the child parent thing isn''t anything radical that you won''t have done yourself, no doubt, it''s simply a question of who you are willing to have as the parents of a child. If you have two parents and insist the child is one of them, then that is the equivilant of using a microbial DNA approach, where one cell attacks another and injects part of its DNA into the cell overwriting part of the current genotype. This is opposed to not allowing the child to be one of its parents and having a standard two-new-parents-overwrite-the-child approach.

As to the science/art thing, this is what this post was all about. GA''s are very much an art at one level of understanding and very much studied as a science at a much deeper level.
You can tweak parameters to get a GA to work without any understanding of the underlying problem and the GA will improve if you get the parameters right. However I know some people will swear by microbial reproduction (as mentioned above), others will swear that crossover is the important genetic operator, others who will say mutation does all the work, still more that insist that a population of 10,000 is too small, while some only use 1+1 population sizes. The list goes on.

Some things I''ve learnt are that visualising the fitness landscape you''re creating is highly important. This is so you can design the GA, so that a small change in the genotype leads to a small change in the phenotype. Further, the shape of the landscape is important, a smooth landscape where fitness increases and decreases like rolling hills is far better than a Manhatten skyline, where fitness can suddenly drop off or rise up. For a GA to achieve hill-climbing across a smooth fitness landscape is much, much easier than for it to achieve hill-climbing across a landscape dotted with sudden, inexplicable falls in fitness.

Elitism is also a very touchy subject, especially in noisy evaluations (for example, where its possible for one solution to do well or badly depending on its random starting position). With a small population, no re-evaluations and elitism it is possible for a bad, but lucky, genotype to take over the gene pool very quickly. Even with large populations, if you don''t re-evaluate your elite members and they never get overwritten then they can reduce your fit population half its fitness in a few generations.

There''s also the subject or neutral (note the ''t'') networks, areas of equal fitness on a landscape where there is no increase available in the immediate area. If you view the fitness graph of a population on a neutral ridge or plateau, moving through fitness space, it will look like they''ve reached an optimal fitness and are staying at one point on the landscape. However, they may well be moving about at random until, 1,000 generations later they hit an area of increased fitness a great distance from where they first hit the area of neutrality. Suddenly your fitness graph moves up for no reason (apparent to you), unless you gave up 2 generations ago presuming the optimum had been reached.

These are just a few topics that people who _really_ know about GA''s are studying (I''m not claiming to be one of those people, although I''m better than most), making GA''s more powerful scientific tools. Which is why I was wondering how other people viewed them.
"Mostly as art" is a perfectly good answer, as long as you''re using them, but you understand why some people use them once and deem them useless soon after, due to thinking that GA''s are simple, that they know everything about them and deciding they''re just not that good.

To quote Adrian Thompson (the first guy to do evolvable hardware) "GA''s are not magic, but we''re not quite sure just how not magic they are".

Sorry for the rant and thanks for listening,

Mike
quote: Original post by MikeD
Timkin, the child parent thing isn''t anything radical that you won''t have done yourself, no doubt, it''s simply a question of who you are willing to have as the parents of a child. If you have two parents and insist the child is one of them, then that is the equivilant of using a microbial DNA approach, where one cell attacks another and injects part of its DNA into the cell overwriting part of the current genotype. This is opposed to not allowing the child to be one of its parents and having a standard two-new-parents-overwrite-the-child approach.


Hehehe... thought you were saying something else completely... you simply meant allowing the child to be a copy of its parent (or one of its parents). Got it.

On the ART/SCIENCE aspect of using GAs (and AI in general). I find that there are far too many people who are not prepared to put in the effort to learn the ''science'' behind a technique and simply rely on the ''art'' of tweaking parameters to get a ''good fit''. To me good art comes from a having full understanding of something (the science) and then applying experience, intuition, inspiration and persperation to it, be it a canvas, a chunk of clay or a collection of binary strings.

I guess what I am saying is that if you never have a full understanding of the problem and the solution technique, you can never be sure you found a good solution, only one that seems better than no solution at all (or the one scribbled out on paper the night before! )

quote: Original post by MikeD

"Mostly as art" is a perfectly good answer, as long as you''re using them, but you understand why some people use them once and deem them useless soon after, due to thinking that GA''s are simple, that they know everything about them and deciding they''re just not that good.



This is what frustrates me the most. Those that knock something simply because they failed to learn how to use it properly and then it broke.

Ack, enough ranting from me. My apologies to anyone offended by my opinion.

Cheers,

Timkin

This topic is closed to new replies.

Advertisement