【优化求解】基于GUI界面之遗传算法优化求解【Matlab 180期】

一、简介

1 遗传算法简介
遗传算法是一种模拟自然进化的优化搜索算法。由于它仅依靠适应度函数就可以搜索最优解,不需要有关问题解空间的知识,并且适应度函数不受连续可微等条件的约束,因此在解决多维、高度非线性的复杂优化问题中得到了广泛应用和深入研究。
遗传算法在模式识别、神经网络、机器学习、工业优化控制、自适应控制、生物科学、社会科学等方面都得到应用。
2 遗传算法原理
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

二、源代码

function varargout = yichuan(varargin)
% YICHUAN MATLAB code for yichuan.fig
%      YICHUAN, by itself, creates a new YICHUAN or raises the existing
%      singleton*.
%
%      H = YICHUAN returns the handle to a new YICHUAN or the handle to
%      the existing singleton*.
%
%      YICHUAN('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in YICHUAN.M with the given input arguments.
%
%      YICHUAN('Property','Value',...) creates a new YICHUAN or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before yichuan_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to yichuan_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help yichuan

% Last Modified by GUIDE v2.5 15-Jul-2016 21:52:11

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @yichuan_OpeningFcn, ...
                   'gui_OutputFcn',  @yichuan_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{
    
    1})
    gui_State.gui_Callback = str2func(varargin{
    
    1});
end

if nargout
    [varargout{
    
    1:nargout}] = gui_mainfcn(gui_State, varargin{
    
    :});
else
    gui_mainfcn(gui_State, varargin{
    
    :});
end
% End initialization code - DO NOT EDIT


% --- Executes just before yichuan is made visible.
function yichuan_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to yichuan (see VARARGIN)
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
clear all;  
close all;

三、运行结果

在这里插入图片描述

四、备注

完整代码或者代写添加QQ912100926
往期回顾>>>>>>
【优化求解】粒子群算法之充电站最优布局【Matlab 061期】
【优化求解】遗传算法之多旅行商问题【Matlab 062期】
【优化求解】遗传和模拟退火之三维装箱问题【Matlab 063期】
【优化求解】遗传算法之求最短路径【Matlab 064期】
【优化求解】粒子群之优化灰狼算法【Matlab 065期】
【优化求解】多目标之灰狼优化算法MOGWO 【Matlab 066期】
【优化求解】遗传算法之求解优化车辆发车间隔【Matlab 067期】
【优化求解】磷虾群算法简介【Matlab 068期】
【优化求解】差分进化算法简介【Matlab 069期】
【优化求解】约束优化之惩罚函数法简介【Matlab 070期】
【优化求解】改进灰狼算法之求解重油热解模型【Matlab 072期】
【优化求解】蚁群算法之配电网故障定位【Matlab 073期】
【优化求解】遗传算法之求解岛屿物资补给优化问题【Matlab 137期】
【优化求解】基于matlab冠状病毒群体免疫优化算法(CHIO)【Matlab 138期】
【优化求解】基于matlab之金鹰优化求解算法(GEO)【Matlab 139期】
【优化求解】基于GUI界面之BP神经网络优化求解【Matlab 179期】

猜你喜欢

转载自blog.csdn.net/m0_54742769/article/details/113751697