C# 中的遗传算法?
如何用 C# 编写遗传算法? 有可用的图书馆吗? 像 C++ 一样:http://lancet.mit.edu/ga/
How can I write genetic algorithms in C#? Are there libraries available? Like C++: http://lancet.mit.edu/ga/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
评论(4)
~没有更多了~
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
这可能听起来像是一个滑稽的答案,但您需要首先决定您希望遗传算法解决什么问题。 如前所述,旅行推销员问题是一个常见问题,也是了解其工作方式的一种相当好的方法。
我之所以这么说,是因为 GA 最重要的部分之一是适应度函数,没有任何框架会为你编写它。
这篇 2003 年的 codeproject 文章涵盖了:
很容易使用:
这可以升级到.NET 3:
正如您所看到的,其适应度函数期望您的基因表示为双值(而不是例如位字符串)。
然而(这并不是要驳回这篇文章,这很好),只要您知道基本的 GA 是如何工作的,您就可以很容易地自己编写这篇文章。
This may sound like a facetious answer, but you will want to firstly decide what you want the genetic algorithm to solve. As mentioned the Travelling Sales Person problem is a common one and a fairly good way of learning how they work.
I say this as one the most important parts of a GA is the fitness function, which no framework is going to write for you.
This codeproject article from 2003 does cover:
It's easy to use:
This could be upgraded to .NET 3:
As you can see the fitness function for this expects your genes to be represented as double values (rather than for example bit strings).
However (and this is not dismissing the article, which is good), you could write this quite easily yourself providing you know how basic GAs work.