资源简介
生物地理学优化算法由 Dan Simon 提出,资源是这篇文章的源码
代码片段和文件信息
function [MinCost Hamming] = BBO(ProblemFunction DisplayFlag ProbFlag RandSeed)
% [最佳解决方案,hamming距离] = [函数句柄,是否显示打印,是否使用概率更新迁出率,随机数种子]
% 函数句柄 只是 在 初始化中用到
% ProblemFunction = [InitFunction CostFunction FeasibleFunction]
% Biogeography-based optimization (BBO) software for minimizing a general function
% INPUTS: ProblemFunction is the handle of the function that returns
% the handles of the initialization cost and feasibility functions.
% 是返回初始化、成本和可行性函数句柄的函数的句柄
% DisplayFlag = true or false whether or not to display and plot
% results. 是否显示和打印结果
% ProbFlag = true or false whether or not to use probabilities to
% update emigration rates. 是否使用概率更新迁出率
% RandSeed = random number seed 随机数种子
% OUTPUTS: MinCost = array of best solution one element for each generation
% 最佳解决方案数组,每代一个元素
% Hamming = final Hamming distance between solutions 解之间的最终Hamming距离
% CAVEAT: The “ClearDups“ function that is called below replaces duplicates with randomly-generated
% individuals but it does not then recalculate the cost of the replaced individuals.
% 警告:下面调用的“cleardups”函数用随机生成的个体替换重复的个体,但是它不会重新计算被替换个体的成本。
% exit有两种形式:
% (1) b = exist( a ) 若 a 存在,则 b = 1; 否则 b = 0;
% (2) b = exist( ‘name‘ ‘kind‘) kind 表示 name 的类型,可以取的值为:builtin(内建类型),class(类),
% dir(文件夹),file(文件或文件夹),var(变量)
if ~exist(‘DisplayFlag‘ ‘var‘)
DisplayFlag = true;
end
if ~exist(‘ProbFlag‘ ‘var‘)
ProbFlag = false;
end
if ~exist(‘RandSeed‘ ‘var‘)
RandSeed = round(sum(100*clock)); % clock 读取的是系统时间
end
[OPTIONS MinCost AvgCost InitFunction CostFunction FeasibleFunction ...
MaxParValue MinParValue Population] = Init(DisplayFlag ProblemFunction RandSeed); % 初始化这是一个函数
% ProblemFunction = [InitFunction CostFunction FeasibleFunction]
% InitFunction 函数 得到的 OPTIONS
% MinCost AvgCost MinCost是最小损失值,对应的是 最佳适宜度; AvgCost表示的是平均损失值,也就是 适宜度的平均水平
% InitFunction CostFunction FeasibleFunction 来自于函数的句柄 好像是自己定义的好像是??????
% MaxParValue MinParValue 是 InitFunction(OPTIONS) 得到的值
% Population 相当于是一个 栖息地,经过了 去重复、计算损失值、排序之后得到的结果
Population = CostFunction(OPTIONS Population); % 在初始化的时候 执行过了一次
% 栖息地修改概率
OPTIONS.pmodify = 1; % habitat modification probability
% 初始突变概率
OPTIONS.pmutate = 0.005; % initial mutation probability
% 精英参数:从一代人到下一代人,要保留多少最佳栖息地
Keep = 2; % elitism parameter: how many of the best habitats to keep from one generation to the next
% 每代的迁入概率下限
lambdaLower = 0.0; % lower bound for immigration probabilty per gene
% 每代的迁入概率上限
lambdaUpper = 1; % upper bound for immigration probabilty per gene
% 用于概率数值积分的步长
dt = 1; % step size used for numerical integration of probabilities
% 每个栖息地 最大迁入率
I = 1; % max immigration rate for each island
% 每个栖息地 最大迁出率
E = 1; % max emigration rate for each isl
- 上一篇:伪逆法的matlab实现
- 下一篇:基于music算法的天线角度估计
相关资源
- 冈萨雷斯数字图像处理matlab版(第三
- k近邻算法matlab实现
- 基于BP神经网络对几种字体0-9的数字识
- 龚纯《精通MATLAB最优化计算》随书源
- 图像的二进小波分解matlab源码(保证
- p文件,MATLAB的
- MRF matlab源码
- GMM(matlab源码)
- MATLAB数字信号处理85个实用案例精讲入
- 医学图像重建作业matlab源码
- 粒子群算法优化pid源码 matlab仿真.ra
- pca源码matlab
- lvq学习算法源码matlab
- MATLAB电机仿真精华50例PDF+源码
- rbf神经网络求解机器人的运动学逆解
- 通用弹道仿真计算程序V1.0-源码
- CARS-PLS 用于光谱数据或色谱数据变量
- 粒子群算法优化RBF网络matlab源码
- 《信息隐藏技术实验教程》MATLAB源码
- VANET仿真,用matlab实现仿真测试的源码
- EMD matlab实现源码
- 蚁群算法实现三维路径规划Matlab源码
- 产生泊松过程Matlab源码
- 数字图像处理作业canny边缘检测坎尼边
- 《信息隐藏技术实验教程》MATLAB源码
- Sparse Subspace Clustering的论文和源码
- 基于MATLAB的低密度奇偶校LDPC验码编码
- MATLAB R2014a完全自学一本通 源码
- LTE仿真Matlab源码
- 步态识别源码
评论
共有 条评论