Help for this page

Select Code to Download


  1. or download this
    sub gene_length {
        my @gls = sort map { length } keys %genome;
        die "Invalid genotype" unless $gls[0] == $gls[$#gls];
        return $gls[0];
    }
    
  2. or download this
    use List::Util 'first';
    sub check_for_winner {
        return first { get_result($_) == $target } @population
    }
    
  3. or download this
    use List::Util 'sum';
    sub get_population_fitness_score {
        return sum map { get_fitness_score($_) } @population;
    }