资源简介
用于函数优化的五个测试函数,De Jong精选了5个测试函数,这些函数差异表现在连续性、单峰与多峰、二次与非二次、低维与高维、确定函数与随机函数。可以比较完整的测试算法性能。
代码片段和文件信息
/************************************************************
; *
; William M. Spears *
; Navy Center for Applied Research in AI *
; Naval Research Laboratory *
; *
; Permission is hereby granted to copy all or any part of *
; this program for free distribution. *
; *
;************************************************************/
/* Decode the bit string */
int decode(i j k)
int i j k;
{
int sum x n;
sum = 0;
n = 1;
for (x = k - j; x >= 0; x--) {
if (c[i][x + j] == 1) {
sum = sum + n;
}
n = n * 2;
}
return(sum);
}
/* 3 variables 10 bits/variable. */
double f1 (i)
int i;
{
register int x;
double sum pow();
solution = 78.6;
sum = 0.0;
for (x = 0; x <= 2; x++) {
sum = sum + pow(((double)(decode(i (x * 10) + 1 (x * 10) + 10) - 512) / 100.0) 2.0);
}
return(solution - sum);
};
/* 2 variables 12 bits/variable. */
double f2 (i)
int i;
{
double x1 x2;
double pow();
solution = 3905.93;
x1 = (double)(decode(i 1 12) - 2048) / 1000.0;
x2 = (double)(decode(i 13 24) - 2048) / 1000.0;
return(solution - ((100.0 * pow(pow(x1 2.0) - x2 2.0)) + pow(1.0 - x1 2.0)));
};
/* 5 variables 10 bits/variable. */
double f3 (i)
int i;
{
register int x;
int sum;
double temp pow();
solution = 55.0;
sum = 0;
for (x = 0; x <= 4; x++) {
temp = (double)(decode(i (x * 10) + 1 (x * 10) + 10) - 512) /
100.0;
if (temp > 0.0) { sum = sum + (int)temp;}
else { sum = sum + (int)temp - 1; }
}
return(25.0 - (double)sum);
};
/* 30 variables 8 bits/variable. ssrand() needs to be defined to be
a (01) gaussian random variable */
double f4 (i)
int i;
{
register int x;
double sum pow() ssrand();
double temp temp2 temp4;
solution = 1248.2;
sum = 0.0;
for (x = 0; x <= 29; x++) {
temp = ((double)(decode(i (x * 8) + 1 (x * 8) + 8) - 128) / 100.0);
temp2 = temp * temp;
temp4 = temp2 * temp2;
sum = sum + ((double)i * temp4) + ssrand();
}
return(1248.2 - sum);
};
/* 2 variables 17 bits/variable. */
static double f5_a[2][5] = {
{-32.0-16.00.016.032.0}
{-32.0-16.00.016.032.0}
};
double f5_j (i j)
int i j;
{
double save temp temp2 temp6 pow();
temp = ((double)(decode(i 1 17) - 65536) / 1000.0) - f5_a[0][j % 5];
temp2 = temp * temp;
temp6 = temp2 * temp2 * temp2;
save = temp6;
/* The following error was pointed out to me by Andrew Czarn on
Dec 11 2000. Apologies for the typo! */
/*temp = ((double)(decode(i 18 34) - 65536) / 1000.0) - f5_a[1][j % 5];*/
temp = ((double)(decode(i 18 34) - 65536) / 1000.0) - f5_a[1][j / 5];
temp2 = temp * temp;
temp6 = temp2 * temp2 * temp2;
return(save + temp6 + (double)(j + 1));
}
double f5 (i)
int i;
{
register i
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 12841 2010-02-03 11:44 img51.gif
文件 3177 2010-01-17 21:08 dejong.c
----------- --------- ---------- ----- ----
16018 2
- 上一篇:Unity合并网格Demo
- 下一篇:模糊测试
相关资源
- Unity合并网格Demo
- 订餐管理系统
- 在线照片冲印系统客户端源码
- RobotDog 聊天狗
- 在局域网内多播稳定传送大文件
- JPEG图像压缩编码及解码源代码可定图
- Thermodel 中文操作教程
- 巴斯勒相机开发的双相机Demo
-
Openem
bedded User Manual .pdf - 键盘钩子HOOK
- dede 在线考试模块插件
- ATmega128开发板
- Devexpress18.2.7Crack.zip
- 363389zw_stereo_modefilt.zip
- zw_CameraDemo.zip
- zw_92578197fountaincode.zip
- unity 消息分发机制demo
- Ansoft.Serenade.v8.7 注册文件
- altium designer 10破解密钥alf文件
- 大文件UrlDecode工具
- modelsim仿真带ROM的程序需要convert_hex
- idea-gitignore-2.3.0
-
用Jli
nk烧写bootloader到mini2440的Nor f - 黄金矿工as3版本demo
- Devexpress 16.2.5 + 官方汉化+破解
- eCognition Developer 9.01 x64(含crack
- ssh项目demo
- Mac上使用pcsc访问智能卡的xcode工程
- 冒险岛登陆器079SF源码
- RibbonDemo源码
评论
共有 条评论