【优化布局】基于Lichtenberg算法(MOSSPOLA)实现多目标传感器选择与放置优化问题附matlab代码

​1 内容介绍

随着计算的进步和自然界中发现的最佳现象的启发,已经开发了几种能够解决复杂工程问题的算法。这项工作详细介绍了多目标 Lichtenberg 算法的开发,该版本能够处理受径向云内闪电和 Lichtenberg 图形传播启发的新创建的元启发式算法的多个目标。该算法在其优化例程中考虑了一个基于种群和轨迹的混合系统,展示了强大的探索和利用能力,因为它通过大小和不同旋转拍摄的 Lichtenberg 图在目标函数中分配要评估的点在每次迭代中。多目标 Lichtenberg 算法 (MOLA) 是第一个混合多目标元启发式算法,并使用著名和复杂的测试函数组针对传统和最近的元启发式算法进行了测试,并且还约束了复杂的工程问题。

2 部分代码

%% Harmony Search Parallel Machine Scheduling (HS-PMS

clc;

clear;

close all;

global NFE;

NFE=0;

%% Problem Definition

model=CreateModel();        % Create Model of the Problem

CostFunction=@(x) MyCost(x,model);       % Cost Function

nVar=model.nVar;        % Number of Decision Variables

VarSize=[1 nVar];       % Size of Decision Variables Matrix

VarMin = 0;          % Lower Bound of Decision Variables

VarMax = 1;          % Upper Bound of Decision Variables

%% Harmony Search Parameters

MaxIt = 100;     % Maximum Number of Iterations

HMS = 20;         % Harmony Memory Size

nNew = 20;        % Number of New Harmonies

HMCR = 0.9;       % Harmony Memory Consideration Rate

PAR = 0.1;        % Pitch Adjustment Rate

FW = 0.02*(VarMax-VarMin);    % Fret Width (Bandwidth)

FW_damp = 0.995;              % Fret Width Damp Ratio

%% Start

% Empty Harmony Structure

empty_harmony.Position = [];

empty_harmony.Cost = [];

empty_harmony.Sol = [];

% Initialize Harmony Memory

HM = repmat(empty_harmony, HMS, 1);

% Create Initial Harmonies

for i = 1:HMS

HM(i).Position = unifrnd(VarMin, VarMax, VarSize);

[HM(i).Cost HM(i).Sol] = CostFunction(HM(i).Position);

end

% Sort Harmony Memory

[~, SortOrder] = sort([HM.Cost]);

HM = HM(SortOrder);

% Update Best Solution Ever Found

BestSol = HM(1);

% Array to Hold Best Cost Values

BestCost = zeros(MaxIt, 1);

%% Harmony Search Body

for it = 1:MaxIt

% Initialize Array for New Harmonies

NEW = repmat(empty_harmony, nNew, 1);

% Create New Harmonies

for k = 1:nNew

% Create New Harmony Position

NEW(k).Position = unifrnd(VarMin, VarMax, VarSize);

for j = 1:nVar

if rand <= HMCR

% Use Harmony Memory

i = randi([1 HMS]);

NEW(k).Position(j) = HM(i).Position(j);

end

% Pitch Adjustment

if rand <= PAR

%DELTA = FW*unifrnd(-1, +1);    % Uniform

DELTA = FW*randn();            % Gaussian (Normal) 

NEW(k).Position(j) = NEW(k).Position(j)+DELTA;

end

end

% Apply Variable Limits

NEW(k).Position = max(NEW(k).Position, VarMin);

NEW(k).Position = min(NEW(k).Position, VarMax);

% Evaluation

[NEW(k).Cost NEW(k).Sol] = CostFunction(NEW(k).Position);

end

% Merge Harmony Memory and New Harmonies

HM = [HM

NEW]; 

% Sort Harmony Memory

[~, SortOrder] = sort([HM.Cost]);

HM = HM(SortOrder);

% Truncate Extra Harmonies

HM = HM(1:HMS);

% Update Best Solution Ever Found

BestSol = HM(1);

% Store Best Cost Ever Found

BestCost(it) = BestSol.Cost;

% Store NFE

nfe(it)=NFE;

% Iteration 

disp(['In Iteration ' num2str(it) ': NFE = ' num2str(nfe(it)) ', Cost is = ' num2str(BestCost(it))]);

% Plot Res

figure(1);

PlotSolution(BestSol.Sol,model);

end

%% Show Results

figure;

plot(nfe,BestCost,'-og','linewidth',1,'MarkerSize',7,'MarkerFaceColor',[0.9,0.1,0.1]);

title('Harmony Search','FontSize', 15,'FontWeight','bold');

xlabel(' NFE','FontSize', 15,'FontWeight','bold');

ylabel(' Cost Value','FontSize', 15,'FontWeight','bold');

xlim([0 inf])

xlim([0 inf])

ax = gca; 

ax.FontSize = 15; 

set(gca,'Color','b')

legend({'HS PMS'},'FontSize',12,'FontWeight','bold','TextColor','g');

3 运行结果

4 参考文献

[1] Pereira J ,  Oliver G A ,  Francisco M B , et al. Multi-objective lichtenberg algorithm: A hybrid physics-based meta-heuristic for solving engineering problems[J]. Expert Systems with Application, 2022(187-Jan.).

博主简介:擅长智能优化算法神经网络预测信号处理元胞自动机图像处理路径规划无人机雷达通信无线传感器等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值