如何替换不可接受的解决方案?

发布于 2024-09-18 07:36:32 字数 212 浏览 3 评论 0原文

我正在构建遗传算法来最大化数学函数。 初始群体是随机选择的,假设有 20 个个体。 最好的东西会留给下一代。 举办了 18 场比赛,之后个人可以随机 选择组成九对。 从这九对夫妇中,“诞生”了九个孩子。 这是我的问题。其中有几个孩子不符合入境条件 标准。 我决定从下一代中删除这些元素。 我需要的建议是关于更换那些 因不予受理而被删除。 我想过随机生成新个体。 你还有其他想法吗?

路易斯

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

苏大泽ㄣ 2024-09-25 07:36:32

取决于你想要做什么,你可以继续生成随机对,直到你得到 9 个“可接受的”“子代”,或者你可以将它们扔掉,只让“可接受的”子代前进。那会更具进化性。

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.

在巴黎塔顶看东京樱花 2024-09-25 07:36:32

为什么不实施某种临时交叉来生成“可接受的”后代呢?

这是标准做法。但如果这个建议不合适,您能否阐明“不可接受”的含义?

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'?

意犹 2024-09-25 07:36:32

我不使用有性生殖,我认为这就是你正在做的。我让好的东西不变地生存到下一代,坏的东西被好的东西的突变所取代(通常从每个比顺序阈值更好的孩子中创建“孩子”,所以孩子们并不都是相关的给同一个“好”人)。请注意,通过突变,我的意思是对良好“生物”之一的属性进行随机的小改变,而不是创建一个新的完全随机的个体。至少在我看来,这模拟了个体的无性繁殖,并且少量的突变被引入到孩子的 DNA 中。弄清楚需要多少突变是你必须进行实验的事情。更大的种群、更多的世代和更低的突变率似乎效果更好,但情况并非总是如此。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文