[Optimization] based on MATLAB GUI simulated annealing algorithm regional communication network frequency planning [including Matlab source code 933]

[Optimization] based on MATLAB GUI simulated annealing algorithm regional communication network frequency planning [including Matlab source code 933]

1. Introduction

Introduction to Simulated Annealing Algorithm




3 Parameters of Simulated Annealing Algorithm
Simulated annealing is an optimization algorithm. It cannot exist independently. It needs an application. Temperature is the parameter that needs to be optimized for simulated annealing. If it is applied to cluster analysis , Then it means that one or several parameters need to be optimized in cluster analysis, and this parameter or parameter set is represented by temperature. It can be a certain index, a certain degree of relevance, a certain distance, and so on.

2. the source code

function varargout = simulatedannealing_gui(varargin) gui_Singleton = 1 ; gui_State = struct( 'gui_Name' , mfilename, ... 'gui_Singleton' , gui_Singleton, ... 'gui_OpeningFcn' , @simulatedannealing_gui_OpeningFcn, ... 'gui_OutputFcn' , @simulatedannealing_gui_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 simulatedannealing_gui is made visible. function simulatedannealing_gui_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 simulatedannealing_gui (see VARARGIN) % Choose default command line output for simulatedannealing_gui handles.output = hObject; % Update handles structure guidata (hObject, handles) ; % UIWAIT makes simulatedannealing_gui wait for user response (see UIRESUME) % uiwait ( handles.figure1 ) ; % --- Outputs from this function are returned to the command line. function varargout = simulatedannealing_gui_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved-to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout { 1 } = handles.output ; function edit1_Callback (hObject, eventdata , handles) % hObject handle to edit1 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get (hObject, 'String' ) returns contents of edit1 as text % str2double (get(hObject, 'String' )) returns contents of edit1 as a double % --- Executes during object creation, after setting all properties. function edit1_CreateFcn (hObject, eventdata , handles) % hObject handle to edit1 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles empty-handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set (hObject, 'BackgroundColor' , 'white' ) ; else set (hObject, 'BackgroundColor' ,get( 0 , 'defaultUicontrolBackgroundColor' )); end function edit2_Callback (hObject, eventdata , handles) % hObject handle to edit2 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get (hObject, 'String' ) returns contents of edit2 as text % str2double (get(hObject, 'String' )) returns contents of edit2 as a double % --- Executes during object creation, after setting all properties. function edit2_CreateFcn (hObject, eventdata , handles) % hObject handle to edit2 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles empty-handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set (hObject, 'BackgroundColor' , 'white' ) ; else set (hObject, 'BackgroundColor' ,get( 0 , 'defaultUicontrolBackgroundColor' )); end function edit3_Callback (hObject, eventdata , handles) % hObject handle to edit3 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get (hObject, 'String' ) returns contents of edit3 as text % str2double (get(hObject, 'String' )) returns contents of edit3 as a double % --- Executes during object creation, after setting all properties. function edit3_CreateFcn (hObject, eventdata , handles) % hObject handle to edit3 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles empty-handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set (hObject, 'BackgroundColor' , 'white' ) ; else set (hObject, 'BackgroundColor' ,get( 0 , 'defaultUicontrolBackgroundColor' )); end function edit4_Callback (hObject, eventdata , handles) % hObject handle to edit4 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get (hObject, 'String' ) returns contents of edit4 as text % str2double (get(hObject, 'String' )) returns contents of edit4 as a double % --- Executes during object creation, after setting all properties. function edit4_CreateFcn (hObject, eventdata , handles) % hObject handle to edit4 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles empty-handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set (hObject, 'BackgroundColor' , 'white' ) ; else set (hObject, 'BackgroundColor' ,get( 0 , 'defaultUicontrolBackgroundColor' )); end function edit6_Callback (hObject, eventdata , handles) % hObject handle to edit6 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get (hObject, 'String' ) returns contents of edit6 as text % str2double (get(hObject, 'String' )) returns contents of edit6 as a double % --- Executes during object creation, after setting all properties. function edit6_CreateFcn (hObject, eventdata , handles) % hObject handle to edit6 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles empty-handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set (hObject, 'BackgroundColor' , 'white' ) ; else set (hObject, 'BackgroundColor' ,get( 0 , 'defaultUicontrolBackgroundColor' )); end function edit7_Callback (hObject, eventdata , handles) % hObject handle to edit7 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get (hObject, 'String' ) returns contents of edit7 as text % str2double (get(hObject, 'String' )) returns contents of edit7 as a double % --- Executes during object creation, after setting all properties. function edit7_CreateFcn (hObject, eventdata , handles) % hObject handle to edit7 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles empty-handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set (hObject, 'BackgroundColor' , 'white' ) ; else set (hObject, 'BackgroundColor' ,get( 0 , 'defaultUicontrolBackgroundColor' )); end Copy code

3. running results

4. remarks

Version: 2014a

1. Introduction

Introduction to Simulated Annealing Algorithm




3 Parameters of Simulated Annealing Algorithm
Simulated annealing is an optimization algorithm. It cannot exist independently. It needs an application. Temperature is the parameter that needs to be optimized for simulated annealing. If it is applied to cluster analysis , Then it means that one or several parameters need to be optimized in cluster analysis, and this parameter or parameter set is represented by temperature. It can be a certain index, a certain degree of relevance, a certain distance, and so on.

2. the source code

function varargout = simulatedannealing_gui(varargin) gui_Singleton = 1 ; gui_State = struct( 'gui_Name' , mfilename, ... 'gui_Singleton' , gui_Singleton, ... 'gui_OpeningFcn' , @simulatedannealing_gui_OpeningFcn, ... 'gui_OutputFcn' , @simulatedannealing_gui_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 simulatedannealing_gui is made visible. function simulatedannealing_gui_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 simulatedannealing_gui (see VARARGIN) % Choose default command line output for simulatedannealing_gui handles.output = hObject; % Update handles structure guidata (hObject, handles) ; % UIWAIT makes simulatedannealing_gui wait for user response (see UIRESUME) % uiwait ( handles.figure1 ) ; % --- Outputs from this function are returned to the command line. function varargout = simulatedannealing_gui_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved-to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout { 1 } = handles.output ; function edit1_Callback (hObject, eventdata , handles) % hObject handle to edit1 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get (hObject, 'String' ) returns contents of edit1 as text % str2double (get(hObject, 'String' )) returns contents of edit1 as a double % --- Executes during object creation, after setting all properties. function edit1_CreateFcn (hObject, eventdata , handles) % hObject handle to edit1 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles empty-handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set (hObject, 'BackgroundColor' , 'white' ) ; else set (hObject, 'BackgroundColor' ,get( 0 , 'defaultUicontrolBackgroundColor' )); end function edit2_Callback (hObject, eventdata , handles) % hObject handle to edit2 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get (hObject, 'String' ) returns contents of edit2 as text % str2double (get(hObject, 'String' )) returns contents of edit2 as a double % --- Executes during object creation, after setting all properties. function edit2_CreateFcn (hObject, eventdata , handles) % hObject handle to edit2 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles empty-handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set (hObject, 'BackgroundColor' , 'white' ) ; else set (hObject, 'BackgroundColor' ,get( 0 , 'defaultUicontrolBackgroundColor' )); end function edit3_Callback (hObject, eventdata , handles) % hObject handle to edit3 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get (hObject, 'String' ) returns contents of edit3 as text % str2double (get(hObject, 'String' )) returns contents of edit3 as a double % --- Executes during object creation, after setting all properties. function edit3_CreateFcn (hObject, eventdata , handles) % hObject handle to edit3 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles empty-handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set (hObject, 'BackgroundColor' , 'white' ) ; else set (hObject, 'BackgroundColor' ,get( 0 , 'defaultUicontrolBackgroundColor' )); end function edit4_Callback (hObject, eventdata , handles) % hObject handle to edit4 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get (hObject, 'String' ) returns contents of edit4 as text % str2double (get(hObject, 'String' )) returns contents of edit4 as a double % --- Executes during object creation, after setting all properties. function edit4_CreateFcn (hObject, eventdata , handles) % hObject handle to edit4 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles empty-handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set (hObject, 'BackgroundColor' , 'white' ) ; else set (hObject, 'BackgroundColor' ,get( 0 , 'defaultUicontrolBackgroundColor' )); end function edit6_Callback (hObject, eventdata , handles) % hObject handle to edit6 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get (hObject, 'String' ) returns contents of edit6 as text % str2double (get(hObject, 'String' )) returns contents of edit6 as a double % --- Executes during object creation, after setting all properties. function edit6_CreateFcn (hObject, eventdata , handles) % hObject handle to edit6 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles empty-handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set (hObject, 'BackgroundColor' , 'white' ) ; else set (hObject, 'BackgroundColor' ,get( 0 , 'defaultUicontrolBackgroundColor' )); end function edit7_Callback (hObject, eventdata , handles) % hObject handle to edit7 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get (hObject, 'String' ) returns contents of edit7 as text % str2double (get(hObject, 'String' )) returns contents of edit7 as a double % --- Executes during object creation, after setting all properties. function edit7_CreateFcn (hObject, eventdata , handles) % hObject handle to edit7 (see GCBO) % eventdata reserved-to be defined in a future version of MATLAB % handles empty-handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set (hObject, 'BackgroundColor' , 'white' ) ; else set (hObject, 'BackgroundColor' ,get( 0 , 'defaultUicontrolBackgroundColor' )); end Copy code

3. running results

4. remarks

Version: 2014a
complete code or writing plus 1564658423