I've been looking for some good genetic programming examples for C#. Anyone knows of good online/book resources? Wonder if there is a C# library out there for Evolutionary/Genetic programming?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
I maintain a port of ECJ in C#. It's great.
If you're interested in genetic algorithms or heuristic optimization in general you might want to take a look at HeuristicLab. It is developed for several years, 1.5 years since we released the new version. It is programmed in C# 4 and has a nice GUI. There are many algorithms already available like Genetic Algorithm, Genetic Programming, Evolution Strategy, Local Search, Tabu Search, Particle Swarm Optimization, Simulated Annealing and more. There are also several problems implemented like a vehicle routing problem, traveling salesman, real function optimization, knapsack, quadratic assignment problem, classification, regression, and many more. There are tutorials also and we have protocol buffers integrated so you can communicate with external programs for solution evaluation. It is licensed under GPL. In 2009 the software has received the Microsoft innovation award of Microsoft Austria.
We've also written a book on the subject: Genetic Algorithms and Genetic Programming.
Do you mean actual genetic programming, as opposed to genetic algorithms in general?
If so, C#/.net isn't the best language for it. LISP, for example, has always been a mainstay of GP.
However, if you must, you're probably going to want to dynamically generate CIL / MSIL. You could do this using System.Reflection.Emit, however I'd recommend Mono.Cecil. It lacks good docs (as if reflection emit has them).. But it offers much better assembly emission and reflection.
Another issue is that it is less than trivial to load code, and later dispose of it, in the .net framework. At least, you cannot unload assemblies. You can unload appdomains, but the whole business of loading code into a seperate appdomain, and calling it externally can get pretty messy. .NET 3.5's System.Addin stuff should make this easier.
I have a free product that may help. The Genetic Algorithm Framework .Net 4.0 is a single .Net 4.0 assembly with some supporting articles.
MSDN had an article last year about genetic programming: Genetic Algorithms: Survival of the Fittest with Windows Forms
I've forked ECJ to C# .NET 4.0 if you are interested in a full-featured Evolutionary Computation framework. The package includes everything from the original ECJ Java project, including all of the working samples.
I also wrote 500 unit tests to verify many aspects of the conversion. But many more tests are needed. In particular, the distributed computation aspects are not fully tested. That's because I plan on converting from ECJ's simple use of sockets to a more robust strategy using WCF and WF. I'll also be reworking the framework to utilize TPL (Task Parallel Library).
Anyway, you can download the initial conversion here:
http://branecloud.codeplex.com
I am also in the process of converting several other frameworks from Java to .NET that relate to "synthetic intelligence" research (when I can find the time).
Ben