Prev: Wavelet-Galerkin
Next: element array
From: jia on 7 Aug 2010 23:37 I hope to customize the GA based on the GA tool provided by Matlab. I met two problems about how to define one of the functions. 1. if I hope to customize the FitnessScalingFcn, The document says: """Scaling function (FitnessScalingFcn) specifies the function that performs the scaling. Your scaling function must have the following calling syntax: function expectation = myfun(scores, nParents) The input arguments to the function are (1) scores — A vector of scalars, one for each member of the population; (2) nParents — The number of parents needed from this population; The function returns expectation, a row vector of scalars of the same length as scores, giving the scaled values of each member of the population. The sum of the entries of expectation must equal nParents.""" 2. The document says if I want to customize the" Selection function (SelectionFcn)" """Your selection function must have the following calling syntax: function parents = myfun(expectation, nParents, options) The input arguments to the function are: -- expectation — Expected number of children for each member of the population -- nParents— Number of parents to select ---options — Genetic algorithm options structure""" I check one of the codes in a selection function (e.g. selectionroulette), it has one line: "expectation = expectation(:,1);" My question is that what the "expectation" is? For FitnessScalingFcn I cite, it mentions expectation is a row vector, but for the selection function (e.g. selectionroulette), it uses "expectation(:,1)". Could someone help me? Regards,
|
Pages: 1 Prev: Wavelet-Galerkin Next: element array |