目录
1 概述
2 运行结果
3 参考文献
4 Matlab代码
生产调度问题作为企业生产管理和计算机集成制造系统的核心部分,近年来一直受到广大学者的密切关注。其主要任务是分配有限的企业资源,达到经济或性能上的需求目标。显而易见,系统、全面、合理、优化的生产调度方案不仅有助于提高企业的综合管理水平,而且可以为企业带来显著的经济效益。
生产调度问题己被证明属于NP-hard问题,因此传统的优化方法己不能有效地求解大规模复杂的调度问题。基于此,近年来各种不同的人工智能方法逐渐被引入到调度领域中,取得了很大进展。其中随着计算机技术以及人工智能技术的迅猛发展,群智能优化算法应运而生。它可以在较短的时间内得到令人满意的近似最优解,已经成为了一类能够有效解决生产调度问题的新型方法。本文基于随机蛙跳算法(SFLA)解决简单调度问题。
主函数部分代码:
%% Simple Scheduling Problem by Shuffled Frog Leaping Algorithm (SFLA)
% There are 10 jobs or tasks which should be finished in time.
% In "CreateModel.m" file:
% p is process time for jobs
% s is setup time matrix (spaces between boxes in plot)
% d is jobs due
% You can change them.
% q is order of jobs
% ST is start time
% FT is finish time
% z is final cost and Cmax must be equal with it or it is a violation.
%%------------------------------------------------------------------
clc;
clear;
close all;
%% Problem
model=CreateModel();
CostFunction=@(s) MyCost(s,model); % Cost Function
nVar=model.n; % Number of Decision Variables
VarSize=[1 nVar]; % Decision Variables Matrix Size
VarMin=0; % Lower Bound of Variables
VarMax=1; % Upper Bound of Variables
%% SFLA Parameters
MaxIt = 100; % Maximum Number of Iterations
nPopMemeplex = 5; % Memeplex Size
nPopMemeplex = max(nPopMemeplex, nVar+1); % Nelder-Mead Standard
nMemeplex = 5; % Number of Memeplexes
nPop = nMemeplex*nPopMemeplex; % Population Size
I = reshape(1:nPop, nMemeplex, []);
% FLA Parameters
fla_params.q = max(round(0.3*nPopMemeplex), 2); % Number of Parents
fla_params.alpha = 3; % Number of Offsprings
fla_params.beta = 5; % Maximum Number of Iterations
fla_params.sigma = 2; % Step Size
fla_params.CostFunction = CostFunction;
fla_params.VarMin = VarMin;
fla_params.VarMax = VarMax;
%% Initialization
% Empty Individual Template
empty_individual.Position = [];
empty_individual.Cost = [];
empty_individual.Sol = [];
% Initialize Population Array
pop = repmat(empty_individual, nPop, 1);
% Initialize Population Members
for i = 1:nPop
pop(i).Position = unifrnd(VarMin, VarMax, VarSize);
[pop(i).Cost pop(i).Sol] = CostFunction(pop(i).Position);
end
% Sort Population
pop = SortPopulation(pop);
% Update Best Solution Ever Found
BestSol = pop(1);
% Initialize Best Costs Record Array
BestCosts = nan(MaxIt, 1);
[1]韩炜. 基于改进蛙跳算法的生产调度问题研究[D].华东理工大学,2014.
部分理论引用网络文献,若有侵权联系博主删除。