-
遗传算法C
很好用的c
注:前两个文件存储为m文件并放在工作目录下,运行结果为
p =
0.0000 -0.0000 0.0055
大家可以直接绘出f(x)的图形来大概看看f(x)的最值是多少,也可是使用优化函数来验证。matlab命令行执行命令:
fplot("x+10*sin(5*x)+7*cos(4*x)",[0,9])
evalops是传递给适应度函数的参数,opts是二进制编码的精度,termops是选择maxGenTerm结束函数时传递个maxGenTerm的参数,即遗传代数。xoverops是传递给交叉函数的参数。mutops是传递给变异函数的参数。
- 2023-05-18 06:50:04下载
- 积分:1
-
假设一个文件中出现了8种符号S0,SQ,S2,S3,S4,S5,S6,S7,那么每种符号要编码,至少需要3bit。假设编码成000,001, 010,011,1...
假设一个文件中出现了8种符号S0,SQ,S2,S3,S4,S5,S6,S7,那么每种符号要编码,至少需要3bit。假设编码成000,001, 010,011,100,101,110,111。那么符号序列S0S1S7S0S1S6S2S2S3S4S5S0S0S1编码后变成 000001111000001110010010011100101000000001,共用了42bit。我们发现S0,S1,S2这3个符号出现的频率比较大,其它符号出现的频率比较小,我们采用这样的编码方案:S0到S7的码辽分别01,11,101,0000,0001,0010,0011, 100,那么上述符号序列变成011110001110011101101000000010010010111,共用了39bit。尽管有些码字如 S3,S4,S5,S6变长了(由3位变成4位),但使用频繁的几个码字如S0,S1变短了,所以实现了压缩。对于上述的编码可能导致解码出现非单值性:比如说,如果S0的码字为01,S2的码字为011,那么当序列中出现011时,你不知道是S0的码字后面跟了个1,还是完整的一个S2的码字。因此,编码必须保证较短的编码决不能是较长编码的前缀。符合这种要求的编码称之为前缀编码。要构造符合这样的二进制编码体系,可以通过二叉树来实现。-Suppose a file appears in eight kinds of symbols S0, SQ, S2, S3, S4, S5, S6, S7, then each symbol to be encoded, at least 3bit. Suppose encoding 000,001, 010,011,100,101,110,111. Then the symbolic sequence S0S1S7S0S1S6S2S2S3S4S5S0S0S1 encoded into 000001111000001110010010011100101000000001, sharing a 42bit. We found that S0, S1, S2 these three symbols the frequency of relatively large, the other symbols the frequency is relatively smal
- 2022-04-27 21:17:34下载
- 积分:1
-
图论中最小生成树Kruskal算法 及画图程序 M
图论中最小生成树Kruskal算法 及画图程序 M-函数-Graph theory Kruskal minimum spanning tree algorithm and Paint program M-function
- 2022-04-29 17:29:45下载
- 积分:1
-
With the prim algorithm is seeking to use adjacency matrix storage structure, s...
用普里姆(Prim)算法求用邻接矩阵存储结构表示的图或网的最小生成树-With the prim algorithm is seeking to use adjacency matrix storage structure, said the plan or network, minimum spanning tree
- 2022-02-09 15:56:42下载
- 积分:1
-
涵盖多种算法,非常全面,可以下载到硒…
包罗各种算法,相当全面,可以下载看看,具体有单元加、求进制、汉诺塔、底层编程、小写数字转为大写数字、数据结构、算法基础等等。-Cover a variety of algorithms, is very comprehensive and can be downloaded to see the specific unit plus, and band, Tower of Hanoi, the underlying programming, lower case to upper case the number of figures, data structures, algorithms, etc. basis.
- 2022-01-22 13:32:15下载
- 积分:1
-
自动导入文件到数据库,用于那些无法实时入库,定点时间入库的需求...
自动导入文件到数据库,用于那些无法实时入库,定点时间入库的需求-Automatically import the file to the database, which can not be used for real-time storage, the demand for fixed-point storage time
- 2022-12-22 18:50:03下载
- 积分:1
-
利用MD5函数产生随机的无碰撞的像素选择策略
利用MD5函数产生随机的无碰撞的像素选择策略-The use of MD5 function produces a random collision-free pixel selection strategy
- 2022-01-26 05:15:59下载
- 积分:1
-
本程序用另外一种算法即近邻算法解决TSP,即旅行商问题,请高手指教....
本程序用另外一种算法即近邻算法解决TSP,即旅行商问题,请高手指教.-this procedure with the other algorithms that solve the TSP neighbor algorithm, the traveling salesman problem, experts advise.
- 2022-05-11 02:39:42下载
- 积分:1
-
用内嵌法求多项式
用内嵌法求多项式-with embedded Polynomial Method
- 2022-11-12 06:55:03下载
- 积分:1
-
MAPX开发基础程序,实现简单的地图控制操作
MAPX开发基础程序,实现简单的地图控制操作-MAPX the basis of procedures developed to achieve a simple map control operations
- 2022-05-18 18:19:01下载
- 积分:1