function [res] = chap_5_prob_2_scaled_fn(x, w) % % problem on epage 167 % computes the blended functions f_1 and f_2 on epage 117 (scaled and weighted) % % Inputs: % x in N_pop x N_vars of scaled input variables % % Written by: % -- % John L. Weatherwax 2006-08-28 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- % compute each of the subfunctions f_n: % Fs = chap_5_prob_2_original_fns(x); f_1 = Fs(:,1); f_2 = Fs(:,2); % compute the scaling factors for f_1 and f_2: % f_1_min = 4; f_1_max = 8 + sqrt(2); f_2_min = 9/4; f_2_max = 3 + sqrt(2); % scale each function so that it has a range of between 0,1 % f_1 = ( f_1 - f_1_min )/(f_1_max - f_1_min); f_2 = ( f_2 - f_2_min )/(f_2_max - f_2_min); % blend the functions with w: % res = w * f_1 + ( 1 - w ) * f_2;