1.函数优化

2.符号回归

3.时间序列预测

4.旅行商问题

# 遗传算法简介

Genetic Algorithms（遗传算法）最早由John Holland基于进化观点在1960提出。从那时起相关研究不断进行。

1.随机选择个体，并进行交叉

2.变异

3.计算适应度

4.选择下一个世代的个体

 基因1:0 0 0 1 1 0 1 基因2:1 0 0 1 0 0 0结果  :0 0 0 1 0 0 0

 基因1:0 1 0 0 1 0 1 结果  :0 1 0 0 0 0 1

# 用Aforge.Net实现遗传算法

public class MyOwnFunction : OptimizationFunction1D
{
public MyOwnFunction()
: base( new AForge.Range( 0, 100))
{
}

public override double OptimizationFunction( double x)
{
return Math.Sqrt(x)+ Math.Sin(x/ 23)* 30;

}
}

MyOwnFunction f = new MyOwnFunction();
Population population = new Population( 40, new BinaryChromosome( 32),f, new EliteSelection());

public class EliteSelection : ISelectionMethod
{
/// <summary>
/// Initializes a new instance of the <see cref="EliteSelection"/> class.
/// </summary>
public EliteSelection( ) { }

/// <summary>
/// Apply selection to the specified population.
/// </summary>
///
/// <param name="chromosomes"> Population, which should be filtered. </param>
/// <param name="size"> The amount of chromosomes to keep. </param>
///
/// <remarks> Filters specified population keeping only specified amount of best
/// chromosomes. </remarks>
///
public void ApplySelection( List<IChromosome> chromosomes, int size )
{
// sort chromosomes
chromosomes.Sort( );

chromosomes.RemoveRange( size, chromosomes.Count - size );
}
}

Console.WriteLine( " Start! ");
MyOwnFunction f = new MyOwnFunction();
Population population = new Population( 40,
new BinaryChromosome( 32),f, new EliteSelection());
population.RunEpoch();
double goodX=f.Translate(population.BestChromosome);
Console.WriteLine( " Best Chromosome === >{0} ", goodX);
Console.WriteLine( " Best Result === >{0} ", f.OptimizationFunction(goodX));
Console.WriteLine( " Over! ");

for ( int i = 0; i < population.Size; i++)
{
Console.WriteLine( " chromosome{0} == >{1} ", i, f.Evaluate(population[i]));
}

1.个人觉得AForge.NET用着比matlab方便，因为它的整体架构比较统一，而不像matlab是由工具箱提供的，使用风格迥异。

2.AForge.Net的进化计算这块远远比神经网络部分完整，基本不需要自己实现什么。

3.AForge.Fuzzy中的隶属度函数的表示实现不够丰富，只实现了中间型的两种，我扩写了其他种类的，等整理好了就发出来。