tournament_selection.m ( File view )
Description：Multi-objective optimization (also known as multi-objective programming, vector optimization, multicriteria optimization,multiattribute optimization or Pareto optimization) is an a...
- By moeah 2014-04-18
- Point(s)： 1
function f = tournament_selection(chromosome, pool_size, tour_size) %% function tournament_selection(chromosome, pool_size, tour_size) % is the selection policy for selecting the individuals for the mating % pool. The selection is based on tournament selection. Argument % |chromosome| is the current generation population from which the % individuals are selected to form a mating pool of size |pool_size| after % performing tournament selection, with size of the tournament being % |tour_size|. By varying the tournament size the selection pressure can be % adjusted. But for NSGA-II the tour_size is fixed to two, but the user may % feel free to experiment with different tournament size. Also it has been % observed that a tournament size of more than five has no significant % meaning. % %% Tournament selection process % In a tournament selection process n individuals are selected at random, % where n is equal to |tour_size|. From these individuals only one is selected % and is added to the mating pool, where size of the mating pool is % |pool_size|. Selection is performed based on two criteria. First and % foremost is the rank or the front in which the solutions reside. % Individuals with lower rank are selected. Secondly if the rank of two % individuals are the same then, the crowding distance is compared. % Individuals with greater crowding distance is selcted. % Copyright (c) 2009, Aravind Seshadri % All rights reserved. % % Redistribution and use in source and binary forms, with or without % modification, are permitted provided that the following conditions are % met: % % * Redistributions of source code must retain the above copyright % notice, this list of conditions and the following disclaimer. % * Redistributions in binary form must reproduce the above copyright % notice, this list of conditions and the following disclaimer in % the documentation and/or other materials provided with the distribution % % THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" % AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE % IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE % ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE % LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR % CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF % SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS % INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN % CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) % ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE % POSSIBILITY OF SUCH DAMAGE. % Get the size of chromosome. The number of chromosome is not important % while the number of elements in chromosome are important. [pop, variables] = size(chromosome); % The peunltimate element contains the information about rank. rank = variables - 1; % The last element contains information about crowding distance. distance = variables; % Until the mating pool is filled, perform tournament selection for i = 1 : pool_size % Select n individuals at random, where n = tour_size for j = 1 : tour_size % Sel ... ... （Please download the complete source code to view）
Want complete source code? Download it here
0 lines left, continue to read
File listTips: You can preview the content of files by clicking file names^_^