Location:
Search - initpop
Search list
Description: 提供一个人工免疫算法源程序,其算法过程包括:
1.设置各参数
2.随机产生初始群体——pop=initpop(popsize,chromlength)
3.故障类型编码,每一行为一种!code(1,:),正常;code(2,:),50%;code(3,:),150%。实际故障测得数据编码,这里Unnoralcode,188%
4.开始迭代(M次):
1)计算目标函数值:欧氏距离[objvalue]=calobjvalue(pop,i)
2)计算群体中每个个体的适应度fitvalue=calfitvalue(objvalue)
3)选择newpop=selection(pop,fitvalue) objvalue=calobjvalue(newpop,i) %
交叉newpop=crossover(newpop,pc,k) objvalue=calobjvalue(newpop,i) %
变异newpop=mutation(newpop,pm) objvalue=calobjvalue(newpop,i) %
5.求出群体中适应值最大的个体及其适应值
6.迭代停止判断。-provide a source of artificial immune algorithm, the algorithm process include : 1. Two of the parameters set. Initial randomly generated groups -- pop = initpop (popsize, chromlength) 3. Fault type coding, each act a! Code (1 :), normal; Code (2, :), 50%; Code (3 :), 150%. Fault actual measured data coding, here Unnoralcode, 188% 4. Beginning iteration (M) : 1) the objective function value : Euclidean distance [objvalue] = calobjvalue (pop, i) 2) calculation of each individual groups of fitness calfitvalue fitvalue = ( objvalue) 3) = newpop choice selection (pop, fitvalue) objvalue = calobjvalue (newpop, i) =% newpop cross-crossover (newpop, pc, k) = calobjvalue objvalue (newpop, i) =% variation newpop mutation (newpop, pm ) objvalue = calobjvalue (newpop, i)% 5. groups sought to adapt th
Platform: |
Size: 9012 |
Author: 江泉 |
Hits:
Description: 包含一个cpp文件,含有main()函数!
主要函数如下
void InitData();
int Flip(float probabiliby);
float Random(); //generate a pseudorandom integer from 0 to 1
void ResetRandom(); //reset pseudorandom integer array fRand
float ObjFunc(float vx);
float DeCode(unsigned * pChrom);
void StatPop(POP * pop);
void InitPop(); //initialize population
void InitReport(); //initial info report
unsigned Select();
int Mutation(unsigned chromval);
int CrossOver(unsigned * parent1,unsigned * parent2,int popidx);
void UpdateGen();
void Report(int gen);
Platform: |
Size: 537650 |
Author: arkzhu |
Hits:
Description: 提供一个人工免疫算法源程序,其算法过程包括:
1.设置各参数
2.随机产生初始群体——pop=initpop(popsize,chromlength)
3.故障类型编码,每一行为一种!code(1,:),正常;code(2,:),50%;code(3,:),150%。实际故障测得数据编码,这里Unnoralcode,188%
4.开始迭代(M次):
1)计算目标函数值:欧氏距离[objvalue]=calobjvalue(pop,i)
2)计算群体中每个个体的适应度fitvalue=calfitvalue(objvalue)
3)选择newpop=selection(pop,fitvalue) objvalue=calobjvalue(newpop,i) %
交叉newpop=crossover(newpop,pc,k) objvalue=calobjvalue(newpop,i) %
变异newpop=mutation(newpop,pm) objvalue=calobjvalue(newpop,i) %
5.求出群体中适应值最大的个体及其适应值
6.迭代停止判断。-provide a source of artificial immune algorithm, the algorithm process include : 1. Two of the parameters set. Initial randomly generated groups-- pop = initpop (popsize, chromlength) 3. Fault type coding, each act a! Code (1 :), normal; Code (2, :), 50%; Code (3 :), 150%. Fault actual measured data coding, here Unnoralcode, 188% 4. Beginning iteration (M) : 1) the objective function value : Euclidean distance [objvalue] = calobjvalue (pop, i) 2) calculation of each individual groups of fitness calfitvalue fitvalue = ( objvalue) 3) = newpop choice selection (pop, fitvalue) objvalue = calobjvalue (newpop, i) =% newpop cross-crossover (newpop, pc, k) = calobjvalue objvalue (newpop, i) =% variation newpop mutation (newpop, pm ) objvalue = calobjvalue (newpop, i)% 5. groups sought to adapt th
Platform: |
Size: 9216 |
Author: 江泉 |
Hits:
Description: 几个matlab小程序,主要用于遗传算法仿真-Several small matlab program, mainly for genetic algorithm simulation
Platform: |
Size: 4096 |
Author: 林宇 |
Hits:
Description: 自然计算中遗传算法的各个程序,matlab环境下开发的源代码。best.m 求种群中适应度最大的值
calfitvalue.m 计算每个个体的适应度
calobjvalue.m 适应度函数
crossover.m 交叉变换
decodebinary.m 将二进制数转换成十进制数
decodechrom.m 将二进制数转换成十进制数
initpop.m 产生初始种群
mutation.m 变异
selection.m 选择合适的个体进行复制
main.m 主函数
-Nature of each genetic algorithm calculation procedures, matlab environment with source code. best.m find the largest population in the fitness value of calfitvalue.m calculated for each individual' s fitness calobjvalue.m fitness function crossover.m cross-conversion decodebinary.m Converts a binary number into decimal number decodechrom.m Converts a binary number into decimal number initpop.m generate initial population mutation.m variation selection.m select the appropriate individual to copy main.m primary function
Platform: |
Size: 3072 |
Author: 王芳 |
Hits:
Description: GA算法代码 function pop=initpop(popsize,chromlength)
pop=round(rand(popsize,chromlength))
rand 随机产生每个单元为 {0,1} 行数为 popsize,列数为 chromlength 的矩阵,
roud 对矩阵的每个单元进行圆整。这样产生的初始种群。
2.2 计算目标函数值
2.2.1 将二进制数转化为十进制数(1)
遗传算法子程序 Name: decodebinary.m
产生 [2^n 2^(n-1) ... 1] 的行向量,然后求和,将二进制转化为十进制-GA algorithm code function pop=initpop(popsize,chromlength)
pop=round(rand(popsize,chromlength))
rand 随机产生每个单元为 {0,1} 行数为 popsize,列数为 chromlength 的矩阵,
roud 对矩阵的每个单元进行圆整。这样产生的初始种群。
2.2 计算目标函数值
2.2.1 将二进制数转化为十进制数(1)
遗传算法子程序 Name: decodebinary.m
产生 [2^n 2^(n-1) ... 1] 的行向量,然后求和,将二进制转化为十进制
Platform: |
Size: 2048 |
Author: Sonic |
Hits:
Description: 一个matlab遗传算法源程序遗传算法实例也是自己找来的,原代码有少许错误,本人都已更正了,调试运行都通过了的。对于初学者,尤其是还没有编程经验的非常有用的一个文件-A genetic algorithm matlab source code examples genetic algorithm also got their own, the original code was flawed, I have been corrected, and have passed the commissioning. For beginners, especially not a very useful document programming experience
Platform: |
Size: 4096 |
Author: 李 |
Hits:
Description: 求matlab编的遗传算法源程序,用于求解带约束的优化问题。-Seeking matlab genetic algorithm source code for solving optimization problems with constraints.
Platform: |
Size: 3072 |
Author: zhuqk |
Hits: