学习了一个学期的人工智能,了解到了人工智能的强大力量.很多智能算法真是很令人向往!
下面是我实现的蚁群算法.
下面介绍一下什么是蚁群算法:
主要是一种模拟生物的进化:
用信息素来引导蚂蚁向比较好的方向前进.
用我们熟悉的鲁迅先生的一句话:地上没有路,走的人多了也就有了路.(用在蚁群算法身上很好)
using
System;
using System.Collections.Generic;
using System.Text;
namespace AntSystem
... {
public class AA
...{
/**//// <summary>
/// 对信息量的重视程度
/// </summary>
private int alpha;
/**//// <summary>
/// 启发式信息的受重视程度
/// </summary>
private int beta;
/**//// <summary>
/// 信息素的挥发速度
/// </summary>
private double lo;
/**//// <summary>
/// 城市距离矩阵
/// </summary>
private double[,] City;
/**//// <summary>
/// 信息素矩阵
/// </summary>
private double[,] Message;
/**//// <summary>
/// opneList用于存放下一步可行城市
/// </summary>
private Queue<int> openList=new Queue<int> ();
/**//// <summary>
/// closedList用于存放已经访问过的城市
/// </summary>
private Queue<int> closedList=new Queue<int> ();
/**//// <summary>
/// 储存较好的路径
/// </summary>
private Queue <int> BestList=new Queue<int> ();
private int Pro_time = 0;
/**//
using System.Collections.Generic;
using System.Text;
namespace AntSystem
... {
public class AA
...{
/**//// <summary>
/// 对信息量的重视程度
/// </summary>
private int alpha;
/**//// <summary>
/// 启发式信息的受重视程度
/// </summary>
private int beta;
/**//// <summary>
/// 信息素的挥发速度
/// </summary>
private double lo;
/**//// <summary>
/// 城市距离矩阵
/// </summary>
private double[,] City;
/**//// <summary>
/// 信息素矩阵
/// </summary>
private double[,] Message;
/**//// <summary>
/// opneList用于存放下一步可行城市
/// </summary>
private Queue<int> openList=new Queue<int> ();
/**//// <summary>
/// closedList用于存放已经访问过的城市
/// </summary>
private Queue<int> closedList=new Queue<int> ();
/**//// <summary>
/// 储存较好的路径
/// </summary>
private Queue <int> BestList=new Queue<int> ();
private int Pro_time = 0;
/**//