请问有什么专家帮我吗? [英] can any expert help me in this please?
问题描述
如何使用遗传算法编写c#程序来解决9-queen问题,该算法通过随机化使用的随机数生成器生成不同的解决方案。每代使用6个样本。
(在屏幕上)应打印三个项目
第一个代表解决方案为字符串(如152693847),第二个给出了达到解决方案所需的世代数,最后一个代表解决方案如下:
。 。 。 。 X 。 。 。 。
。 。 。 。 。 。 X 。 。
。 。 。 。 。 。 。 。 X
。 。 。 X 。 。 。 。 。
。 X 。 。 。 。 。 。 。
。 。 。 。 。 。 。 X。
。 。 。 。 。 X 。 。 。
。 。 X 。 。 。 。 。 。
X. 。 。 。 。 。 。 。
代码应在不到一秒的时间内运行。
< blockquote>这是一个非常常见的问题,您可以通过Google找到样本和想法。
how can i Write c# program to solve the 9-queen problem using genetic algorithm that generates a different solution each run by randomizing the random number generator used. Use 6 samples in each generation.
(on the screen) three items should be printed
The first one represents the solution as a string(like 152693847), the second gives the number of generations required to reach the solution and the last one represents the solution as follows:
. . . . X . . . .
. . . . . . X . .
. . . . . . . . X
. . . X . . . . .
. X . . . . . . .
. . . . . . . X .
. . . . . X . . .
. . X . . . . . .
X . . . . . . . .
the code should run in less than a second.
This is a very common question and you can find samples and ideas via Google.
这篇关于请问有什么专家帮我吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!