
function [Fit] = fit_func(Chrom, Inherit, Pdata, Tdata)

[npro, natt] = size(Pdata);

% obtain the number of Chromosomes in Inherit list
NI = size(Inherit,1);

[NC LC] = size(Chrom);

% initial the fitness value 
Fit(NC,1) = 0;

% control whether to training a new SVM
flag = 0;

for i=1:NC
    
    flag = 0;
    
    for j=1:NI
        % if find same chromosome in Inherit set
        if Chrom(i,:) == Inherit(j,1:LC)
            Fit(i,1) = Inherit(j,LC+1);
            flag = 1;
        end
	 end
        % if does not find same chromosome in Inherit set
    if flag == 0           
		[Fit(i,:), junk] = fwpsabe(Pdata, Tdata, Chrom(i, 1:npro), Chrom(i, npro+1 : end ));
    end
end