| Genetic Algorithm and Direct Search Toolbox | ![]() |
Fitness Scaling Options
Fitness scaling converts the raw fitness scores that are returned by the fitness function to values in a range that is suitable for the selection function. You can specify options for fitness scaling in the Fitness scaling pane.
Scaling function (FitnessScalingFcn) specifies the function that performs the scaling. The options are
Rank (@fitscalingrank) -- The default fitness scaling function, Rank, scales the raw scores based on the rank of each individual instead of its score. The rank of an individual is its position in the sorted scores. The rank of the most fit individual is 1, the next most fit is 2, and so on. Rank fitness scaling removes the effect of the spread of the raw scores.
Proportional (@fitscalingprop) -- Proportional scaling makes the scaled value of an individual proportional to its raw fitness score.
Top (@fitscalingtop) -- Top scaling scales the top individuals equally. Selecting Top displays an additional field, Quantity, which specifies the number of individuals that are assigned positive scaled values. Quantity can be an integer between 1 and the population size or a fraction between 0 and 1 specifying a fraction of the population size. The default value is 0.4. Each of the individuals that produce offspring is assigned an equal scaled value, while the rest are assigned the value 0. The scaled values have the form [0 1/n 1/n 0 0 1/n 0 0 1/n ...].
Shift linear (@fitscalingshiftlinear) -- Shift linear scaling scales the raw scores so that the expectation of the fittest individual is equal to a constant multiplied by the average score. You specify the constant in the Max survival rate field, which is displayed when you select Shift linear. The default value is 2.
Custom enables you to write your own scaling function. If your function has no input arguments, enter it in the text box in the form @myfun. If your function does have input arguments, enter it as a cell array of the form {@myfun, P1, P2, ...}, where P1, P2, ... are the input arguments. Your scaling function must have the following calling syntax.
The input arguments to the function are
scores -- A vector of scalars, one for each member of the population
nParents -- The number of parents needed from this population
P1, P2, ... -- Additional input arguments, if any, that you want to pass to the function
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.
| Population Options | Selection Options | ![]() |
| © 1994-2010 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |