摘要: 标准PSO算法的C语言实现。测试函数为y=x*sin(10*PI*x)+2,x取值范围[-1,2],求最大值。View Code 1 /* 2 用粒子群算法求函数最值测试 3 测试函数为 y=x*sin(10*pi*x)+2 4 x取值范围[-1, 2] 5 */ 6 #include <stdio.h> 7 #include <math.h> 8 #include <time.h> 9 #include <stdlib.h>10 11 #define MAX(a,b) ((a)>(b)?(a):(b))12 #define PI 3.14 阅读全文
posted @ 2012-05-26 22:11 BeatLJ 阅读(2153) 评论(0) 推荐(1) 编辑