Inventory Optimization Control Based on Teaching-Learning Algorithm with MATLAB Code

1 Content Introduction

This article briefly analyzes the current research status of swarm intelligence optimization algorithms, with a detailed description of the “Teaching-Learning” optimization algorithm, and analyzes the performance, advantages, and disadvantages of the “Teaching-Learning” algorithm. Several improved “Teaching-Learning” optimization algorithms are then introduced, and the application research situation of the “Teaching-Learning” optimization algorithm is discussed. Finally, the current problems existing in the “Teaching-Learning” optimization algorithm are explained, and future research directions for the “Teaching-Learning” optimization algorithm are pointed out.

Inventory Optimization Control Based on Teaching-Learning Algorithm with MATLAB Code

Inventory Optimization Control Based on Teaching-Learning Algorithm with MATLAB Code

2 Simulation Code

% 
%------------------------------------------clc;clear;close all;warning('off');%%-----------------------------------------model=CreateM();                        % Create Modelmodel.Umax=100;CostFunction=@(xhat) MyCost(xhat,model);  % Cost FunctionVarSize=[model.K model.H];   % Size of Decision Variables MatrixnVar=prod(VarSize);    % Number of Decision VariablesVarMin=0;         % Lower Bound of VariablesVarMax=1;         % Upper Bound of Variables%% TLBO ParametersMaxIt = 250;        % Maximum Number of IterationsnPop = 150;           % Population Size%% Start% Empty Structure for Individualsempty_individual.Position = [];empty_individual.Cost = [];empty_individual.Sol=[];% Initialize Population Arraypop = repmat(empty_individual, nPop, 1);% Initialize Best SolutionBestSol.Cost = inf;% Initialize Population Membersfor i = 1:nPoppop(i).Position = unifrnd(VarMin, VarMax, VarSize);[pop(i).Cost, pop(i).Sol]= CostFunction(pop(i).Position);if pop(i).Cost < BestSol.CostBestSol = pop(i);endend% Initialize Best Cost RecordBestCosts = zeros(MaxIt, 1);%% TLBO Bodyfor it = 1:MaxIt% Calculate Population MeanMean = 0;for i = 1:nPopMean = Mean + pop(i).Position;endMean = Mean/nPop;% Select TeacherTeacher = pop(1);for i = 2:nPopif pop(i).Cost < Teacher.CostTeacher = pop(i);endend% Teacher Phasefor i = 1:nPop% Create Empty Solutionnewsol = empty_individual;% Teaching FactorTF = randi([1 2]);% Teaching (moving towards teacher)newsol.Position = pop(i).Position ...+ rand(VarSize).*(Teacher.Position - TF*Mean);% Clippingnewsol.Position = max(newsol.Position, VarMin);newsol.Position = min(newsol.Position, VarMax);% Evaluation[newsol.Cost, newsol.Sol]= CostFunction(newsol.Position);% Comparisionif newsol.Cost<pop(i).Costpop(i) = newsol;if pop(i).Cost < BestSol.CostBestSol = pop(i);endendend% Learner Phasefor i = 1:nPopA = 1:nPop;A(i) = [];j = A(randi(nPop-1));Step = pop(i).Position - pop(j).Position;if pop(j).Cost < pop(i).CostStep = -Step;end% Create Empty Solutionnewsol = empty_individual;% Teaching (moving towards teacher)newsol.Position = pop(i).Position + rand(VarSize).*Step;% Clippingnewsol.Position = max(newsol.Position, VarMin);newsol.Position = min(newsol.Position, VarMax);% Evaluation[newsol.Cost, newsol.Sol]= CostFunction(newsol.Position);% Comparisionif newsol.Cost<pop(i).Costpop(i) = newsol;if pop(i).Cost < BestSol.CostBestSol = pop(i);endendend% Store Record for Current IterationBestCosts(it) = BestSol.Cost;% Show Iteration Informationdisp(['In Iteration ' num2str(it) ': TLBO Best Cost Is = ' num2str(BestCosts(it))]);figure(1);PlotSol(BestSol.Sol,model);pause(0.01);endtitle('TLBO Optimal Inventory Control');%% Plotfigure;semilogy(BestCosts,'k', 'LineWidth', 2);xlabel('Iteration');ylabel('Best Cost');grid on;

3 Running Results

Inventory Optimization Control Based on Teaching-Learning Algorithm with MATLAB Code

Inventory Optimization Control Based on Teaching-Learning Algorithm with MATLAB Code

4 References

[1] Cheng Y. A Study on the Scheduling Problem of Fuzzy Flexible Job Shop Based on Teaching-Learning Optimization Algorithm. Journal of Xinxiang University, 2021, 38(9):6.

[2] Yang W., Gu X. Research on Rescheduling and Inventory Optimization of Continuous Production Process Based on Chaotic Optimization Algorithm. Journal of East China University of Science and Technology: Natural Science Edition, 2006, 32(7):4.

Author’s Bio: Specializing in intelligent optimization algorithms, neural network prediction, signal processing, cellular automata, image processing, path planning, UAVs, and various fields of MATLAB simulation. Relevant MATLAB code issues can be discussed privately.

Some theories cited from online literature; if there is any infringement, please contact the author for deletion.

Leave a Comment