@staticmethod<EOL><INDENT>def _calc_fitness_function(centres, data, chromosomes):<DEDENT>
<EOL>count_chromosome = len(chromosomes)<EOL>fitness_function = np.zeros(count_chromosome)<EOL>for _idx_chromosome in range(count_chromosome):<EOL><INDENT>centres_data = np.zeros(data.shape)<EOL>for _idx in range(len(data)):<EOL><INDENT>centres_data[_idx] = centres[_idx_chromosome][chromosomes[_idx_chromosome][_idx]]<EOL><DEDENT>fitness_function[_idx_chromosome] += np.sum(abs(data - centres_data))<EOL><DEDENT>return fitness_function<EOL>
!
        @brief Calculate fitness function values for chromosomes.

        @param[in] centres (list): Cluster centers.
        @param[in] data (list): Input data that is used for clustering process.
        @param[in] chromosomes (list): Chromosomes whose fitness function's values are calculated.

        @return (list) Fitness function value for each chromosome correspondingly.