目录
1 概述
2 运行结果
2.1 标题2.1
2.2 main1运行结果
2.2 main2运行结果
3 Matlab代码
4 参考文献
电气代码 | 智能算法及其应用 |
路径规划 | 神经网络预测 |
优化调度 | 图像处理 |
车间调度 | 信号处理 |
浪漫的她 | 我的哲思 |
数学建模 | 完整代码事宜 |
柔性作业车间调度问题(Flexible Job shop Sched-uling Problem , FJSP)是在离散制造业和流程工业中应用广泛的一类问题,已被证明是典型的 NP-上hard问题。
FJSP是作业车间调度问题(Job shop Scheduling Prob-lem,JSP)的扩展,FJSP中每个工件的每道工序均可以在可选择的有限台机器上加工,且在每台机器上的加工时间不一定相同,可灵活地进行资源选择,提高调度的敏捷性,更加贴近实际生产。目前元启发式算法是解决FJSP的常用方法,其主要可分为群体智能算法和局部搜索算法。陆家辉等人提出一种混合。
Jaya优化算法求解柔性作业车间调度问题,并设计一种离散化更新算子使Jaya 优化算法更适用于FJSP,混合2种新型邻域结构提高算法的同守儿→军等人[2将化学反应算法与禁忌搜索相结合,设计了4种操作来保证种群多样性,以实现最优的全局探索,加人禁忌搜索提高了混合算法的局部寻优能力。
详细讲解:车间调度专栏
本文包括五种优化算法进行比较,分别是:遗传算法、粒子群优化算法、模拟退火算法、蚂蚁算法、禁忌搜索算法
下面看看运行结果比较:
function [costs, bestSol] = PSO(jobs, m, n, particals, iterations, costFunc)
c1 = 1.4944;
c2 = 1.4944;
w = 0.79;
gbests = ones(1, n);
gbest = costFunc(gbests, jobs, m, n);
lbests = randi(m, particals, n);
lbest = ones(1, particals);
costs = ones(iterations, 1);
costsEnd = 0;
for i = 1:particals
lbest(i) = costFunc(lbests(i, :), jobs, m, n);
if lbest(i) < gbest
gbest = lbest(i);
gbests = lbests(i, :);
end
end
x = lbests;
v = zeros(particals, n);
for i = 1:iterations
ibest = costFunc(ones(particals, n), jobs, m, n);
r1 = rand(particals, 1);
r2 = rand(particals, 1);
v = w*v + c1 * bsxfun(@times, r1, lbests - x) + ...
c2 * bsxfun(@times, r2, (bsxfun(@minus, gbests, x)));
x = round(x + v);
%x = bsxfun(@mod, x, m) + 1;
x(x < 1) = 1;
x(x > m) = m;
for j = 1:particals
c = costFunc(x(j, :), jobs, m, n);
if c < ibest
ibest = c;
end
if c < lbest(j)
lbest(j) = c;
lbests(j, :) = x(j, :);
end
end
costsEnd = costsEnd + 1;
costs(costsEnd) = ibest;
[ilbest, idx] = min(lbest);
%ibest
ilbests = lbests(idx, :);
if ilbest < gbest
gbest = ilbest;
gbests = ilbests;
end
end
bestSol = gbests;
end
function [costs, bestSol] = PSO(jobs, m, n, particals, iterations, costFunc)
c1 = 1.4944;
c2 = 1.4944;
w = 0.79;
gbests = ones(1, n);
gbest = costFunc(gbests, jobs, m, n);
lbests = randi(m, particals, n);
lbest = ones(1, particals);
costs = ones(iterations, 1);
costsEnd = 0;
for i = 1:particals
lbest(i) = costFunc(lbests(i, :), jobs, m, n);
if lbest(i) < gbest
gbest = lbest(i);
gbests = lbests(i, :);
end
end
x = lbests;
v = zeros(particals, n);
完整代码:基于GA/PSO/SA/ACO/TS优化算法的车间调度比较
function [costs, bestSol] = PSO(jobs, m, n, particals, iterations, costFunc)
c1 = 1.4944;
c2 = 1.4944;
w = 0.79;
gbests = ones(1, n);
gbest = costFunc(gbests, jobs, m, n);
lbests = randi(m, particals, n);
lbest = ones(1, particals);
costs = ones(iterations, 1);
costsEnd = 0;
for i = 1:particals
lbest(i) = costFunc(lbests(i, :), jobs, m, n);
if lbest(i) < gbest
gbest = lbest(i);
gbests = lbests(i, :);
end
end
x = lbests;
v = zeros(particals, n);
function [costs, bestSol] = PSO(jobs, m, n, particals, iterations, costFunc)
c1 = 1.4944;
c2 = 1.4944;
w = 0.79;
gbests = ones(1, n);
gbest = costFunc(gbests, jobs, m, n);
lbests = randi(m, particals, n);
lbest = ones(1, particals);
costs = ones(iterations, 1);
costsEnd = 0;
for i = 1:particals
lbest(i) = costFunc(lbests(i, :), jobs, m, n);
if lbest(i) < gbest
gbest = lbest(i);
gbests = lbests(i, :);
end
end
x = lbests;
v = zeros(particals, n);
function [costs, bestSol] = PSO(jobs, m, n, particals, iterations, costFunc)
c1 = 1.4944;
c2 = 1.4944;
w = 0.79;
gbests = ones(1, n);
gbest = costFunc(gbests, jobs, m, n);
lbests = randi(m, particals, n);
lbest = ones(1, particals);
costs = ones(iterations, 1);
costsEnd = 0;
for i = 1:particals
lbest(i) = costFunc(lbests(i, :), jobs, m, n);
if lbest(i) < gbest
gbest = lbest(i);
gbests = lbests(i, :);
end
end
x = lbests;
v = zeros(particals, n);
[1]王玉芳,曾亚志,蒋亚飞.基于自适应灰狼优化算法的柔性作业车间调度问题[J].现代制造工程,2022(7):1-10
[2]张守京,杜昊天,侯天天.求解多目标双资源柔性车间调度问题的改进NSGA-Ⅱ算法[J].机械科学与技术,2022,41(5):771-778
[3]黄学文,陈绍芬,周阗玉,孙宇婷.求解柔性作业车间调度的遗传算法综述[J].计算机集成制造系统,2022,28(2):536-551
部分理论引用网络文献,如有侵权请联系删除。