资源简介
采用遗传算法解决柔性车间调度问题,完整的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语音信号特征值提取
-
基于matlab的simuli
nk实现2ask2fsk2psk的数 - matlab 画双曲线代码
- 克里金插值的matlab实现
- matlab仿真高斯信道下的QPSK误码率,有
- 基于MATLAB的多元非线性回归模型
- 基于matlab的粒子群算法PSO工具箱
- 基于matlab线性回归模型负荷预测
- pso-SVM的MATLAB程序
- Matlab仿真窄带随机过程
- MATLAB 复数拟合
- MP匹配追踪算法Matlab仿真
- 3自由度机械臂正逆解matlab.zip
- 遗传算法 MATLAB程序合集
- sfm matlab实现
- Matlab数据挖掘算法工具
- LDPC码的matlab仿真
- 抗差最小二乘Matlab代码
- ARIMA模型-matlab代码
- matlab风速仿真模型渐变风文件
- 吴宇飞的turbo编码的MATLAB代码
- 基于matlab的循环谱算法
- 基于Matlab的boxcox变换算法实现
- rvm-matlab工具箱
- MATLABR2016bWindows.txt
- 基于matlab语音信号基音检测
- matlab 录音与音频处理程序
- 线性分组码的MATLAB实现
- 最优控制 优化控制的matlab代码实现
- farthest point sampling
评论
共有 条评论