资源简介
采用遗传算法解决柔性车间调度问题,完整的MATLAB程序,程序中有详细的注释,欢迎大家下载参考,共同学习与进步!

代码片段和文件信息
function [Population] = Coding(TPopSize)
%% INPUT:
% T--input matrix:
% For example:
% A partial flexible scheduling problem in which 8 jobs are processed
% on 8 machines in which the number of available machining machines per
% step of job is less than or equal to the total number of machines
% J1 ={[5 3 5 3 3 0 10 9];[10 0 5 8 3 9 9 6];[0 10 0 5 6 2 4 5]};
% J2 ={[5 7 3 9 8 0 9 0];[0 8 5 2 6 7 10 9];[0 10 0 5 6 4 1 7];[10 8 9 6 4 7 0 0]};
% J3 ={[10 0 0 7 6 5 2 4];[0 10 6 4 8 9 10 0];[1 4 5 6 0 10 0 7]};
% J4 ={[3 1 6 5 9 7 8 4];[12 11 7 8 10 5 6 9];[4 6 2 10 3 9 5 7]};
% J5 ={[3 6 7 8 9 0 10 0];[10 0 7 4 9 8 6 0];[0 9 8 7 4 2 7 0];[11 9 0 6 7 5 3 6]};
% J6 ={[6 7 1 4 6 9 0 10];[11 0 9 9 9 7 6 4];[10 5 9 10 11 0 10 0]};
% J7 ={[5 4 2 6 7 0 10 0];[0 9 0 9 11 9 10 5];[0 8 9 3 8 6 0 10]};
% J8 ={[2 8 5 9 0 4 0 10];[7 4 7 8 9 0 10 0];[9 9 0 8 5 6 7 1];[9 0 3 7 1 5 8 0]};
% T={J1;J2;J3;J4;J5;J6;J7;J8}; 8*1 cell
% Popsize- Population size in genetic algorithms2*PopSize+1
%% OUTPUT:
% Population-Popsize*1 cell
% chromosome-2*1 cell
%% variable declaration
num_of_jobs = length(T); %number of jobs
num_of_machines = length(T{1}{1}); %number of machines
steps_of_job =[];
machine_of_job=cell(num_of_jobs1);
% calculate the length of chromosome
for i = 1:num_of_jobs
steps_of_job=[steps_of_job;length(T{i})];
end
len_of_chromosome = sum(steps_of_job);
% calculate the machine set for each steps of each job
for i=1:num_of_jobs
steps=cell(steps_of_job(i)1);
for j = 1:steps_of_job(i)
machineset=[];
for k=1:length(T{i}{j})
if T{i}{j}(k)~=0
machineset=[machineset k];
end
end
steps{j}=machineset;
end
machine_of_job{i}=steps;
end
%steps chromosome
%Coding is based on the step of the job
step_chromsome=[];
for i = 1:num_of_jobs
for j = 1:steps_of_job(i)
step_chromsome=[step_chromsome i];
end
end
step_population =[];
%Generate population with chromosome containing random genes
for i = 1:PopSize
step_population(i:)=step_chromsome(randperm(length(step_chromsome(:))));
end
%
%machine chromosome
%In each steps the machine is randomly selected for two machines
%and the machine that selects the short processing time is the gene with
%propability
machine_population =[];
for index = 1:PopSize
machine_chromsome=[];
for i=1:num_of_jobs
for j=1:steps_of_job(i)
pos= randperm(length(machine_of_job{i}{j})2);
machine1=machine_of_job{i}{j}(pos(1));
machine2=machine_of_job{i}{j}(pos(2));
if (rand(1)<0.8) && (T{i}{j}(machine1)>T{i}{j}(machine2))
machine = machine2;
else
machine = machine1;
end
machine_chromsome=[machine_chromsome machine];
end
e
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3197 2019-12-13 10:46 FJSP_GA\Coding.m
文件 1165 2019-12-13 10:48 FJSP_GA\FitnessCalculator.m
文件 3491 2019-12-14 15:12 FJSP_GA\GanntGraf.m
文件 122472 2017-10-29 21:57 FJSP_GA\jobshop1.txt
文件 14554 2017-10-29 21:57 FJSP_GA\jobshop2.txt
文件 10407 2019-12-14 17:01 FJSP_GA\POX_GA.m
文件 303 2020-01-03 21:01 FJSP_GA\runme.m
文件 4449 2019-12-14 15:03 FJSP_GA\SemiActiveDecoding.m
文件 2324 2019-12-12 21:38 FJSP_GA\Tmatrix.m
目录 0 2020-01-03 21:02 FJSP_GA
----------- --------- ---------- ----- ----
162362 10
- 上一篇:retinex算法代码MSR
- 下一篇:matlab语音信号特征值提取
相关资源
- matlab_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
评论
共有 条评论