开发者

How to replace inadmissible solutions?

开发者 https://www.devze.com 2023-01-15 23:05 出处:网络
I\'m building a genetic algorithm to maximize a mathematical function. The initial population is randomly selected, lets say of 20 individuals.

I'm building a genetic algorithm to maximize a mathematical function. The initial population is randomly selected, lets say of 20 individuals. The best is kept for the next generation. 18 tournaments are made so that afterwards individuals can be randomly selected to form nine pairs. From the nine pairs, nine children are 'born'. Here is my 开发者_Go百科problem. Several of these children don't meet admissible criteria. I've decided do remove these elements from the next generation. The advice I need is regarding the replacement of the individuals that are removed due to be inadmissible. I've thought of generating new individuals randomly. Do you have other ideas?

Luis


depends on what you want done, you can either keep generating with random pairs until you get 9 'acceptable' 'children' or you can just throw them out and only have the 'acceptable' children advance. That would be more evolutionary.


Why don't you implement some kind of ad-hoc crossover so that generates 'admissible' offspring?

This is standard practice. but if this suggestion is not suitable, can you please articulate what you mean by 'not admissible'?


I don't use sexual reproduction, which I think is what you're doing. I have the good ones survive to the next generation unchanged, and the bad ones replaced with mutations of the good ones (usually creating the "children" from each of the ones better than a threshold in sequence, so the children aren't all related to the same "good" individual). Note that by mutation, I mean making random small changes to the properties of one of the good "creatures", not creating a new totally-random individual. This, in my mind at least, simulates individuals asexually reproducing and small amounts of mutation being introduced into the children's DNA. Figuring out just how much mutation is needed is something you'll have to experiment with. Larger populations with many more generations and a lower mutation rate seem to work better, but that isn't always the case.

0

精彩评论

暂无评论...
验证码 换一张
取 消